1

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?

2 Answers 2

2

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
Sign up to request clarification or add additional context in comments.

Comments

0

Did you try to put that directly in data = data.frame({sql connection=con} SELECT year, sex, age from INFROMATION) ?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.