For extracting list elements, you can use the [[ operator, as in a <- list(6, 5, 4, 3) a[[1]] ## get '6'
For vectors, you can use [, as in a <- c(1,2,4,3,6) a[3] -roger _______________________________ UCLA Department of Statistics [EMAIL PROTECTED] http://www.stat.ucla.edu/~rpeng On Thu, 13 Feb 2003, Jason Bond wrote: > Hello. Sorry for the elementary post. I've looked through the > documentation, but can't seem to find a function which allows one to > extract the position of an element within a list...for example the position > of the element 4 in the vector c(1,2,4,3,6) is 3. Thanks much for any help. > > Jason > > ______________________________________________ > [EMAIL PROTECTED] mailing list > http://www.stat.math.ethz.ch/mailman/listinfo/r-help > ______________________________________________ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help
