On Thu, Mar 15, 2012 at 03:47:24PM -0500, G See wrote: > On second thought, I must not understand your question because your > code works fine for me. > > > my.df[ which(my.df$IDX == c(17, 42)), ] > IDX x > 17 17 -0.5110095 > 42 42 -1.0686427
Hi. This seems to work due to the fact that 17 is odd and 42 is even, so they appear at the right place in recycling c(17, 42). IDX <- 1:50 which(IDX == c(17, 42)) [1] 17 42 which(IDX == c(18, 42)) [1] 42 which(IDX == c(18, 43)) integer(0) Petr Savicky. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.