Dear R developers,
A great R feature is that elements of vectors, lists and dataframes can
have names:
vx = c(a=1, b=2)
lx = list(a=1, b=2)
Accessing element "a" of vx: vx['a']
Accessing element "a" of lx: lx[['a']] or lx$a
Might be a matter of taste, but I like the $ very much. Unfortunately,
vx$a is not
functional. Would it break existing compatibility if the $ would be
allowed to
access elements of a vector, as well?
Best regards,
Matthias
______________________________________________
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.