I would like to read multiple files (RDS dataframes) from my shiny app and append them into one dataframe. Hard for me to reprex here since files are on my HD, but looking for an elegant solution, guidance. Is it possible to use an apply function or should i use loops?
I have the file paths in a vector:
filepaths <- c(f1, f2, f2...)
but not sure how to readRDS then rbind as one line of code to get a dataframe of all file data.
thanks, I was trying to stick to apply or loops, and came up with the working structure below - this works, but I don't have a reprex sicne files are not available:
r_lc_load <- reactive({
req(input$r_lc_file1)
files <- c(input$r_lc_file1$datapath)
d <- list()
for (i in 1:length(files))
{
d[[i]] <- readRDS(files[i])
}
d1 <- dplyr::bind_rows(d)