Read from database and store in R as dataframe

0 votes

Hi, im new to R and want to connect to database, but cant read the table. How to read from database and store in R as dataframe? 

If i use below command to store directly from database to R, it return ssomeother datatype of variable.

Jul 29, 2019 in Data Analytics by radha
1,108 views

1 answer to this question.

0 votes

Your code would fetch you a MySQL object, so use dbReadTable() function 

Use code like below - 

> table_name <- dbReadTable(mydb,"new_table_name")
answered Jul 30, 2019 by anonymous
• 33,030 points

Related Questions In Data Analytics

0 votes
0 answers

Split a string and store it in multiple columns from a field in R

How to Split a string and store ...READ MORE

Jun 29, 2019 in Data Analytics by Anand
875 views
0 votes
1 answer
0 votes
1 answer

Reshape dataframe without “timevar” from long to wide format in R

Assuming that the data is in the ...READ MORE

answered Jun 14, 2018 in Data Analytics by CodingByHeart77
• 3,750 points
987 views
+1 vote
1 answer

Difference between factor and as.factor in R programming

Hey @Ali, as.factor is a wrapper for ...READ MORE

answered Oct 29, 2018 in Data Analytics by Maverick
• 10,840 points
4,858 views
0 votes
1 answer

How to connect to mysql database from rstudio?

Connect to the database as below. install.packages("odbc") db = ...READ MORE

answered Oct 7, 2019 in Data Analytics by anonymous
• 33,030 points
3,647 views
0 votes
1 answer

Error with running SQL Query:

Use below code. ofc <- dbGetQuery(db,'select * from ...READ MORE

answered Oct 1, 2019 in Data Analytics by anonymous
• 33,030 points
1,054 views
0 votes
1 answer

Show SQL equivalent code of dplyr code in R

show_query() translated dplyr code into sql equivalent ...READ MORE

answered Oct 14, 2019 in Data Analytics by Cherukuri
• 33,030 points
2,170 views
0 votes
1 answer

Want a command to be executed in Salt only if a directory is empty

You should consider using this inside your ...READ MORE

answered Jun 12, 2018 in DevOps Tools by Damon Salvatore
• 5,980 points
1,830 views
0 votes
1 answer

Read data from various csv and store it in one dataframe

Use rbind() to join both data frames ...READ MORE

answered Jul 4, 2019 in Data Analytics by anonymous
• 33,030 points
714 views
0 votes
1 answer

Store a built in dataset or dataframe from R to database

dbWriteTable() function allows you to store data ...READ MORE

answered Jul 30, 2019 in Data Analytics by anonymous
• 33,030 points
1,086 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP