> x <- list(seq = 3:7, alpha = c("a", "b", "c"))
> x$alpha
[1] "a" "b" "c"

> x["alpha"]
$alpha
[1] "a" "b" "c"

> x[c(1,2)]
$seq
[1] 3 4 5 6 7

$alpha
[1] "a" "b" "c"

*> x[c(1, alpha[2])]*
*$<NA>*
*NULL*

*$<NA>*
*NULL*

How to access a character subset withing a list?

Thank you for your effort...

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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