HI, May be this works: row.names(MyDF)[c(0,diff(MyDF[,3]))==0|c(0,diff(MyDF[,3]))>1] #[1] "1" "5" "8" A.K.
Hi, Here i have a dataframe called MyDF. a<- c(1,1,1,1,1,1,1,0,1,1) b<-c(1,1,0,1,1,0,0,0,1,1) c<-c(1,2,3,1,1,2,0,5,6,1) d<-c(1,1,1,1,1,1,1,1,0,1) MyDF<-data.frame(DWATT=a,TNH=b,CSGV=c,BIX=d) Requirement is, need to get the "starting row numbers" for a particular coulmn when the value increses continuosly. For Eg:- In this case, i need to get from the third column called 'CSGV'. So, Output should be - Row no:'s - 1,5,8. - Thanks ANTONY. ______________________________________________ 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.