Reputation: 115
I can read data from database using this code:
{sql connection=con} SELECT year, sex, age from INFROMATION
but how I can take that to data.frame?
Upvotes: 1
Views: 627
Reputation: 893
From here:
If you want to assign the results of the SQL query to an R data frame, you can do this using the
output.var
option.
For example:
{sql, connection=con, output.var="info_query"}
SELECT year, sex, age from INFROMATION
Upvotes: 2
Reputation: 167
Did you try to put that directly in data = data.frame({sql connection=con} SELECT year, sex, age from INFROMATION) ?
Upvotes: 0