Top "Sqldf" questions

SQLDF is an R package for running SQL statements on R data frames.

Select the first row by group

From a dataframe like this test <- data.frame('id'= rep(1:5,2), 'string'= LETTERS[1:10]) test <- test[order(test$…

r dataframe sqldf
Summarize with conditions in dplyr

I'll illustrate my question with an example. Sample data: df <- data.frame(ID = c(1, 1, 2, 2, 3, 5), A = c("foo", "bar", "…

r dplyr sqldf
SQLDF Left Join in R

My goal is to take 'matr', sort it by column c1, and keep unique(c1) where c2 = 1. For example, from …

r left-join sqldf
R: how to rbind two huge data-frames without running out of memory

I have two data-frames df1 and df2 that each have around 10 million rows and 4 columns. I read them into R …

r memory memory-management data.table sqldf
NA values using sqldf

If I try to get an average of c(NA, NA, 3, 4, 5, 6, 7, 8, 9, 10) using AVG from SQL, I get a value of 5.2, …

sql r sqldf
Failed to connect the database when using sqldf in r

I loaded a csv file to my R, and when I Tried to use sqldf to select some column, it …

r sqldf
Using sqldf and RPostgreSQL together

When using RPostgreSQL I find that I cannot use sqldf in the same way. For example if I load the …

sql r postgresql sqldf rpostgresql
sqldf: query data by range of dates

I am reading from a huge text file that has '%d/%m/%Y' date format. I want to use …

r sqldf
Cumulative sum by group in sqldf?

I have a data frame with 3 variables: place, time, and value (P, T, X). I want to create a fourth …

r sqldf
How to get date using sqldf?

I have a data frame that has a "DATE" field. e.g.: "24-10-2015" The variable is in the date …

r date sqldf