Hi,

I have a list of 100, each list has 20 elements, and I would like to
select the first 7 elements in each list.
Let's take the alphabet as an example.

x <- lapply(1:100, function(i) sample(LETTERS))

I tried x[[1:7]], but it doesn't work. Can anyone enlighten me on how
to do such selections?

Thank you.

Kang Min

______________________________________________
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