How to create a new table in database from R?

0 votes

How to create a new table in database from R?

Sep 25 in Data Analytics by ch
• 3,290 points
43 views

1 answer to this question.

0 votes

Use dbGetQuery to create a table by writing create a statement as below.

Ex:

> db = dbConnect(odbc(),
               Driver = "MySQL ODBC 5.3 ANSI Driver",
               Server = "127.0.0.1",
               database = "wrgwrgrge",
               uid = "fawgawrgwrg",
               pwd = "sdawf")

> dbGetQuery(db,"create table dummy ( Id INT PRIMARY KEY,Name VARCHAR(5))")
data frame with 0 columns and 0 rows
answered Oct 14 by Cherukuri
• 32,260 points

Related Questions In Data Analytics

0 votes
1 answer

How to create a new R6 Class in R?

You have to first create an object ...READ MORE

answered Jul 5, 2018 in Data Analytics by DataKing99
• 8,130 points
166 views
0 votes
1 answer

How to create dummy variables based on a categorical variable of lists in R?

You can use mtabulate in the following way: library(qdapTools) cbind(data[1], ...READ MORE

answered Apr 13, 2018 in Data Analytics by CodingByHeart77
• 3,690 points
620 views
0 votes
1 answer

How to convert a sentence to word table in R?

Try the following code: sentence <- c("case sweden", ...READ MORE

answered Jun 21, 2018 in Data Analytics by darklord
• 6,190 points
33 views
0 votes
1 answer

How to create a box-plot using “plotly” in R?

You can use this command to create ...READ MORE

answered Jul 4, 2018 in Data Analytics by CodingByHeart77
• 3,690 points
1,338 views
0 votes
1 answer
0 votes
1 answer

How to create a date variable in R?

Create a string with date notation as ...READ MORE

answered Jul 16 in Data Analytics by anonymous
38 views
0 votes
1 answer

How to create a Heatmap in R?

Its very simple. Use heatmap function and ...READ MORE

answered Nov 3 in Data Analytics by Cherukuri
• 32,260 points
38 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
28 views
0 votes
2 answers

How to create a table in R without external file?

Tibble also creates a table-like structure. Use below ...READ MORE

answered Sep 3 in Data Analytics by anonymous
• 32,260 points
77 views
0 votes
4 answers

How to remove NA values from a Vector in R?

You can try na.omit() or na.exclude() too. ...READ MORE

answered Jul 31 in Data Analytics by anonymous
• 32,260 points
9,650 views