I'm trying to use lapply to create a list of dataframes, as demonstrated in this answer: https://stackoverflow.com/a/17197201/3843046
My data is in the form of tab separated values, so I have tried this:
temp <- list.files(pattern = "*.txt", full.names = TRUE)
Fresh1 <- lapply(temp,read.table,sep="\t",skip=21,USE.NAMES = TRUE)
And I get this error when running the second line:
Error in FUN(c("./AB5 025.txt", "./AB5 05.txt", "./AB5 1.txt", "./AB5 2.txt", :
unused argument (USE.NAMES = TRUE)
I need to somehow keep the data frames in the list connected with the files they are originating from. Can someone explain how I am misusing USE.NAMES, or if there is another way using lapply or some other method that would perform the same purpose?