mysql - How to use the value of a variable as the name of an array in R -


i starting rscript commandargs(true , variable <- args[1].

in variable name of column of mysql database. select column dynamically , query rohdaten <- dbgetquery(con, sql)

the result array. want this:

rohdaten$xxx[rohdaten$xxx==null]<-na xxx value of variable

how can set xxx value of variable? tried many things variations of rohdaten$get(variable)

instead of calling

rohdaten$xxx 

try

rohdaten[variable] 

this translate whatever variable is, e.g.

rohdaten["columnname"] 

Comments

Popular posts from this blog

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -