Rstudio crash when using lapply and bind_rows

Hi, I'm trying to merge several csv files into one, my code was working a few days ago but now whenever I try to use it, Rstudio crashes when I call for lapply. Do you have any idea of why this might be ?
In my folder I only have .csv files (around 150).

I'm using R version 4.2.1 on Windows 10 and RStudio 2022.07.2 Build 576.
Here it is :

library("dplyr")                                                
library("readr")  

setwd("my path")

data <- list.files(pattern = "*.csv", full.names = TRUE) %>% 
  lapply(read_csv) %>%                                           
  bind_rows  

You could be running out of RAM, monitor your RAM allocation while running your code to see if that is the case.

Incidentally, you could use purrr::map_dfr() instead of the two steps of lapply() and bind_rows().

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.