[R] subset dataframe by rows using character vector?

2009-04-14 Thread zack holden
Dear List, I'm stuck on what seems like a simple indexing problem, I'd be very grateful to anyone willing to help me out. I queried a dataframe which returns a character vector called plot. I have another dataframe from which I want to subset or select only those rows that match plot.

Re: [R] subset dataframe by rows using character vector?

2009-04-14 Thread baptiste auguie
Is this what you want? plotNames - c(plot1, plot2, plot3) # plot is probably best left as the name of the base function full.data[full.data$PLOTID %in% plotNames, ] # note the comma HTH, baptiste On 14 Apr 2009, at 15:20, zack holden wrote: Dear List, I'm stuck on what seems like

Re: [R] subset dataframe by rows using character vector?

2009-04-14 Thread baptiste auguie
, thanks again. Zack CC: r-help@r-project.org From: ba...@exeter.ac.uk To: zack_hol...@hotmail.com Subject: Re: [R] subset dataframe by rows using character vector? Date: Tue, 14 Apr 2009 15:56:45 +0100 Is this what you want? plotNames - c(plot1, plot2, plot3