Thank you very much. It works outside of function, but not work in function. I have 10 years of data and need read all of them. The function passes input table full name and select columns and return extracted table. Something like
readit <- function(fullname){
file <- glue(fullname)
print (file) # file contains correct sas table name
indata <- read_sas(file, col_select=c(1,2,3))
outdata <- indata %>% rename('Description'=desc)
return(outdata)
}
New1 <- readit("c:/temp/iris1.sas7bdat ")
New2 <- readit("c:/temp/iris2.sas7bdat ")
Again the error message is “Error in read_sas(file, col_select = c(1, 2, 3)) : unused argument (col_select = c(1, 2, 3))”. It seems like read_sas not recognizing the passed parameter. Any solution to this?