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 in Data Analytics by radha
38 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 29 by anonymous
• 32,260 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 28 in Data Analytics by Anand
49 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 13, 2018 in Data Analytics by CodingByHeart77
• 3,690 points
74 views
0 votes
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,040 points
579 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 in Data Analytics by anonymous
• 32,260 points
56 views
0 votes
1 answer

Error with running SQL Query:

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

answered Oct 1 in Data Analytics by anonymous
• 32,260 points
40 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 in Data Analytics by Cherukuri
• 32,260 points
30 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,510 points
48 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 in Data Analytics by anonymous
• 32,260 points
36 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 29 in Data Analytics by anonymous
• 32,260 points
29 views