agustgisla
2011-Mar-25 11:08 UTC
[R] Removing object - searching/googlin' ..and more hasn't helped :(
I know this is probably really easy thing but... I've loaded data into R from the net. I've got 97 subjects (in a database). I'm supposed to remove subjects "lower than 140 cm".. Of course it's easy to find the subject (i.e. number 83 and 84) - but how can I delete these subjects from the database in R? (delete the entire row..)? I've spent 2 hours searching the net now.. And my laptop is lucky to still be on the table, but nut out in the snow! Thanks for reading, every suggestion is appreciated! Best regards, August -- View this message in context: http://r.789695.n4.nabble.com/Removing-object-searching-googlin-and-more-hasn-t-helped-tp3405106p3405106.html Sent from the R help mailing list archive at Nabble.com.
agustgisla
2011-Mar-25 11:11 UTC
[R] Removing object - searching/googlin' ..and more hasn't helped :(
Well, nut = not if someone was wondering.. however I am getting nut...s! :) -- View this message in context: http://r.789695.n4.nabble.com/Removing-object-searching-googlin-and-more-hasn-t-helped-tp3405106p3405113.html Sent from the R help mailing list archive at Nabble.com.
Ben Bolker
2011-Mar-25 13:33 UTC
[R] Removing object - searching/googlin' ..and more hasn't helped :(
agustgisla <agg26 <at> hi.is> writes:> > I know this is probably really easy thing but... > I've loaded data into R from the net. I've got 97 subjects (in a database). > I'm supposed to remove subjects "lower than 140 cm".. Of course it's easy to > find the subject (i.e. number 83 and 84) - but how can I delete these > subjects from the database in R? (delete the entire row..)? > I've spent 2 hours searching the net now.. And my laptop is lucky to still > be on the table, but nut out in the snow! > Thanks for reading, every suggestion is appreciated!You should start by reading the "Introduction to R" that comes with R, which explains how to do this sort of indexing. If your data set is 'd' and the name of the size variable is 'size', d2 <- subset(d,size>140) will work (this doesn't modify the original data set: but if you want you can assign the new version to the original variable, writing over it: d <- subset(d,size>140)