I have to read a file in a list of folders and save data in R.
I use following code for my test data and it works. When I use the code for the actual data then
I get this error
Error: OutOfMemoryError (Java): GC overhead limit exceeded
Called from: top level
This is what I have done for my test data
parent.folder <- "C:/Users/sandesh/Desktop/test_R"
sub.folder <- list.dirs(parent.folder, recursive =TRUE)[-1]
file <- file.path(sub.folder, "sandesh1.xlsx")
library(xlsx)
library(plyr)
fun <- function(file) {
df <- read.xlsx(file, sheetIndex=1)
}
df.big <- ldply(file, fun)