From: Pierre Lapointe <pierrelap_at_gmail.com>

Date: Tue 28 Jun 2005 - 11:24:17 EST

R-help@stat.math.ethz.ch mailing list

https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Tue Jun 28 11:29:01 2005

Date: Tue 28 Jun 2005 - 11:24:17 EST

Hello,

In a dataframe, I want the index if the last non-NA data. Example:

d<-data.frame(matrix(c(1,3,4,2,7,8,1,NA,2),3,3,byrow=TRUE))

I want a vector that gives me 3 2 3

I know about tail and which, but I don't know how not to consider the NA

e.g.: last<-tail(d,1,na.rm=TRUE) still gives me a NA

[[alternative HTML version deleted]]

R-help@stat.math.ethz.ch mailing list

https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Tue Jun 28 11:29:01 2005

*
This archive was generated by hypermail 2.1.8
: Fri 03 Mar 2006 - 03:33:03 EST
*