I would like to import a file in .sas7bdat into R. The file is very big, so I need to import only the rows that match given criteria.
With a file .csv, the code would be
library(sqldf)
read.csv.sql("mtcars.csv", sql = "select * from file where carb in (1,2)" )
How can I do the same thing, but for a .sas7bdat file ?
I already tried with sqldf package :
library(sqldf)
data <- file("file.sas7bdat")
sqldf("select * from data where CONDITION1 eq 'CRITERIA1'")
However, it does not work and it says:
Error in utils::read.table(value, sep = sep, header = header, skip = skip, : duplicate 'row.names' are not allowed