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
Post a Comment