Skip to content
Advertisement

Tag: dbplyr

How to add a vector to a table in backend using dbplyr (R)

I created a table from a data source using tbl(). I need to add a column including 1:nrow() to my dataset and tried different methods but I didn’t succeed. My code is as below: It doesn’t add column ID to my dataset and only adds column step. Using as.data.frame(), it works but so slow. Do you have any ideas? thanks

Syntax error in SQL code being used in R, no row_number function found

I am using RSQLite, DBI, and dbplyr packages. I’m watching this YouTube video by TechTFQ. I’m getting a syntax error with this line. Error: near “row_number”: syntax error I’m certain that the SQL syntax I’m writing here is the same as what I’m watching in the YouTube video, except for the differences in the dataframe that I’m using and the

How can I translate this SQL code to R script using dplyr?

I’m currently working on a project and I want to summarize a column from a joined table twice. SQL code is this: …and the result is this: Database tables are as shown here: I hope that I have provided all the information needed. Question: How can I have the same result in R by only using dplyr library? Table names

Connect to a DB using DBplyr

Problem I am trying to connect to a SQL Server which is on premises using dbplyr using the instructions here but I keep getting an error saying Invalid object name For simplicity I am using the same object naming convention as RStudio has in the instructions at the link above. Code that produces the error I use dbConnect to establish

Advertisement