[R] How to translate string to variable inside a command in an easy way in R
uriblass at gmail.com
Wed Jul 13 13:03:17 CEST 2011
Greg Snow-2 wrote:
"You are suffering from the fact that the longest distance between 2 points
is a shortcut.
The df$column notation is a shortcut for df[[column]] that has some nice
properties, but the shortcut gets in the way when you want to do something
more structured. Try qq1[[z]]==y and avoid all that pasting, parsing, and
Unfortunately I find it to be not correct and unfortunately I see no way to
avoid pasting parsing and evaluating in order
to have functions that does simple things in R.
has no error when
temp<-qq1[qq1[[PrimaryConditionGroup]]=="AMI",] cause the following error
"Error in (function(x, i, exact) if (is.matrix(i)) as.matrix(x)[[i]] else
object 'PrimaryConditionGroup' not found"
I found no way to replace the function that was in the subject of this
thread by something simpler(and here is the function again)
View this message in context: http://r.789695.n4.nabble.com/How-to-translate-string-to-variable-inside-a-command-in-an-easy-way-in-R-tp3645594p3664747.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help