I am reading in excel files in R using the readxl package like this:
library(readxl)
file_names <- list.files(pattern = ".xlsx")
list_collection <- list()
for(i in 1:length(file_names)){
frame <- read_excel(file_names[i], )
frame_sub <- frame[1:100,]
list_collection[i] <- list(frame_sub)
}
Since there are a lot of excel files, and I only want the first 100 rows. Obviously this is not efficient. Is there a way to read in only 100 rows from excel initially, instead of reading in this whole file and THEN subsetting?