Re: [R] compare two rows in same column in data farme

2014-01-02 Thread arun
Hi, May be this helps: dat1 <- read.table(text="line start   A1 21   A2 22   A3 23   B4 19   B2 24   B6 12",sep="",header=TRUE,stringsAsFactors=FALSE) dat1[c(TRUE,diff(dat1[,2]) >0 ),] #  line start #1   A1    21 #2   A2    22 #3   A3    23 #5   B2    24 A.K. On Thursday, January 2, 2014 10:54

[R] compare two rows in same column in data farme

2014-01-02 Thread raz
Hi, I would like to compare row data in the same column through a data frame and remove all rows that do not fit the criteria. for example if I have the following data frame: line start A1 21 A2 22 A3 23 B4 19 B2 24 B6 12 I would like to compare the 'start' value of each line to the value