[R] $ operator is invalid for atomic vectors, returning NULL - what is the right thing to do then?
Soren.Hojsgaard at agrsci.dk
Thu Dec 6 13:04:56 CET 2007
Starting from a recent version of R, the $ became "unusable" on atomic vectors, e.g.
> x <- c(a=1,b=2)
In x$a : $ operator is invalid for atomic vectors, returning NULL
I can of course do
- but that requires more typing (5 characters rather than 2).
Apologies if I've missed a an announcement regarding this, but
1) Is there an alternative to the ['a'] and
2) Why was this change made?
More information about the R-help