[R] get names of list elements

Chirok Han chirok.han at gmail.com
Sat Oct 31 10:56:31 CET 2009


Hi

Consider
> a <- 1:5; b <- 6:10
> x <- list(a=a,b=b)
> y <- list(a,b)

I can get c("a","b") from x using names(x). Is it also possible to get
"a" and "b" from y? (The command "names(y)" gives NULL.)

Thanks in advance.

Chirok




More information about the R-help mailing list