[R] $ operator is invalid for atomic vectors

R. Michael Weylandt michael.weylandt at gmail.com
Sat Sep 15 21:23:12 CEST 2012


> 2) Make the vector a list. I don't know if there are side-Effects to
> this, but perhaps it's just the anxiety of a Java-Programmer who isn't
> used to the somewhat easy-going way R deals with classes:
>        class(dataf2) <- "list"

Indeed, there are _many_ side effects to this and you really should
read up on the differences, but this really is a bad idea in general.
To make it _very_ short, (atomic = regular) vector is a regular array
while a list is an associative array.

Cheers,
Michael




More information about the R-help mailing list