[R] depreciation of $ for atomic vectors

Ido M. Tamir tamir at imp.univie.ac.at
Thu Aug 9 21:20:01 CEST 2007


Dear All,

I would like to know why $ was deprecated for atomic vectors and
what I can use instead.

I got used to the following idiom for working with
data frames:

df <- data.frame(start=1:5,end=10:6)
apply(df,1,function(row){ return(row$start + row$end) })

I have a data.frame with named columns and
use each row to do something. I would like the
named index ($) because the column position
in the data frame changes from time to time. 
The data frame is read from files.

thank you very much,

ido 




'$' returns 'NULL' (with a warning) except for recursive
     objects, and is only discussed in the section below on recursive
     objects.  Its use on non-recursive objects was deprecated in R
     2.5.0.



More information about the R-help mailing list