How can I pass R variable into sqldf? -


i have query this:

sqldf("select tenscore data state_p = 'andhrapradesh'") 

but have "andhrapradesh" in variable statevalue. how can use variable in select query in r same result above.

please show me syntax.

you can use sprintf:

sqldf(sprintf("select tenscore data state_p = '%s'", statevalue)) 

Comments

Popular posts from this blog

php - Embed BBCode within itself not working -

minify - Minimizing css files -

Connecting Spring Batch to Remote Cassandra Database -