Skip to content
Prev 295880 / 398503 Next

Question about extracting certain rows from one column in a data.frame

On Mon, May 28, 2012 at 3:16 PM, Kelly Cool <kellycool79 at yahoo.com> wrote:
I think you're looking for negative indexing (which is, in my opinion,
pretty much the best thing ever)

E.g.,

x <- letters[1:10]

x[1:3] # First three letters

x[-(1:3)] # Without the first three letters

x[-4] # Leave out "d"

etc.

Of course, for this case, you might also want the subset function:

subset(LOG, sample_data_tx %in% c("Noy","PLO"))
No, almost always these sorts of conversions will be taken care of you
automatically

Best,
Michael