Hi R,

 

I wanted to know how do we access the elements of a list. In particular,

 

v=list(c(1,2,3,4,5),c(1,2,33,4,5),c(1,2,333,4,5),c(1,2,3333,4,5))

 

I want to access all the thirds items of the elements of the list. i.e.,
I want to access the elements, 3,33,333,3333. This can be done through
sapply as:

 

sapply(v,function(x) x[3])

 

But I need to access this without using 'sapply'. Like in a data frame,
we do df[2,3] etc.... Any ideas?

 

 

BR, Shubha

This e-mail may contain confidential and/or privileged i...{{dropped:13}}

______________________________________________
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.

Reply via email to