[R] problem with "transform" and "get" functions

peter dalgaard pdalgd at gmail.com
Wed May 22 08:28:38 CEST 2013


On May 22, 2013, at 01:54 , David Winsemius wrote:

>> {
>> test0 <- transform(test, (get(var.names[i])) = 0)
> 
> There is no `get<-` function. You need to use assign.

Also note that transform's "left hand sides" are really names of function arguments and therefore syntactically cannot be expressions. The within() function allows full assignment syntax. 

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



More information about the R-help mailing list