Re: [R] refer to next line within a data-frame an select cases

2008-12-15 Thread Gabor Grothendieck
grep for "pos" or "neg" reducing the data frame to the rows prior to those matched. With this reduced data frame pick out those row2 for which "a" is in row1: # input DF <- data.frame(row1 = c("a", "pos", "a", "neg", "a", "neg", "a", "pos"), row2 = c(12, NA, 3, NA, 5, NA, 11, NA), stringsAsFactor

[R] refer to next line within a data-frame an select cases

2008-12-15 Thread Jörg Groß
Hi, I have a problem sorting and selecting entries within a data-frame and I don't know if it is possible to solve it with R ... (probably yes, but I have no idea how). Following Data; row1row2 a 12 pos NA a 3 neg NA a