[R] R 0.64.2 indexing
Thomas Lumley
thomas at biostat.washington.edu
Thu Aug 19 00:52:17 CEST 1999
On Wed, 18 Aug 1999, Thomas Lumley wrote:
> On Thu, 19 Aug 1999, Peppy wrote:
>
> > Hi,
> >
> > > Say we have a large-sized vector of observation A and a time vector with
> > > the same size. The latter vector basically is the time flag when ith
> > > obervation of A occurs, hence A[i] occurs at T[i].
> > >
>
> T[A ==max(A, na.rm=TRUE) & !is.na(A)]
> does what you want
Perhaps a tidier solution is
T[which(A==max(A,na.rm=TRUE))]
Thomas Lumley
Assistant Professor, Biostatistics
University of Washington, Seattle
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list