Skip to content
Prev 244966 / 398503 Next

selecting certain rows from data frame

On Dec 15, 2010, at 4:18 AM, Ivan Calandra wrote:

            
And to further note that it is only unnecessary of you have no NA's in  
that ID column.

 > DF[4,1] <- NA
 > DF[8,1] <- NA
 > DF2 <- DF[DF$ID==2 | DF$ID==5, ]

(These NA rows would not appear if which() were used.)