Data Science Initiative Introduction To R Bootcamp (part 2)

Same thing again this grep command is really powerful if you want there’s a I wrote this all down in a markdown file as to what the strategy is but it general just so you can we can go so quickly but.

One of the one of the things we can kind of do is this okay read lines of the original slow dot CSV by the way single quotes single quotes.

Are the same as double quotes but you have to you have to match whatever you start with you have to end with although you can’t mix a single quote double quote at the end that’s fine lol equals this guy how do I.

Find those exclamation marks bingo that ok grep in ll for that guy there we are let’s get hey I didn’t spot those ones down the bottom that.

Was me I don’t know how many lines there are how many lines are there we can ask ooh look at that the last couple of lines have these comments we would have missed those that we haven’t gone all the way that if when we gave up.

Halfway through so yeah oh there’s comments comments comments and then I look at this one right in the middle of the real data we probably would have missed those ok so now we can actually just say okay fine then give me all of those guys which is ll- hi.

Okay that’s good when we can actually now we’re back into this hey we haven’t found those guys so let’s look.

For the words with note in them okay notes in here I is equal to this guy that’s not good actually handless let’s just.

Start again because I didn’t actually assign this to I so I was using.

A different file altogether that’s not good okay we get rid of that guy and now we go back and get our note ll equals ll – I let’s just see if there’s any.

Notes left in there did I actually get this right nope never couldn’t find that find this okay life is good you know dang I.

Threw this one away I should have grabbed that one okay I should have kept that one okay but now I can write this out to a file read it back in again alternatively here’s a nice little trick you can use okay which is this which guy don’t worry if you we’re gonna do this read dot CSV on this guy there’s no header there’s no.

Header for this guy so I’m just gonna say d3 and that seems to have gotten that approximately right we’ll see so we’re in good shape now the.

Only thing we want to do is actually go grab those lines look grab the names how would you get those names in to the data frame because okay so whatever so you can read that or you read the help for read CSV.

Okay and you know again this is the vocabulary and the annoying vocabulary that we have to read header.

A logical value indicating whether the file that we’re reading contains the names of the variables as its first line but we chopped everything out.

So it didn’t okay so because there because this particular file this particular file has the first line well weird we got rid of all these lines and then we got rid of these and then this was our first line so it’s not the names of the variables.

So this is bad news okay so how would you get this how would you get the.

In here there we go oh I was hungry I was hoping you were coming back how do I get these names onto the.