[EMAIL PROTECTED] wrote:

Hi R-people

I have a question concerning subsetting. I have a dataframe which contains among other variables 
the variable "subject". For each subject number there are several rows, e.g.:
subject  treatment concentration day
19          a          15,4       1
19          a          18,3       2
19          a           2,3       3

etc.

Im trying to subset the dataframe to get for example only the rows of subject 19 and subject 15. I tried this with

nameofdataframe[nameofdataframe$subject==c(19,15),]

This doesnt work as i get less rows than i should and a warning as well. How can i succeed doing this?

Thanks a lot

Gabi

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


See ?"%in%"

as in

nameofdataframe$subject %in% c(19,15)

Uwe Ligges

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to