TIL Building #Bayesian regression models with {cmdstanr} can result in a ton of large files stored in Temp on the hard drive that can clog the machine. It literally begged me to return to frequentist statistics. #rstats

Issue: https://discourse.mc-stan.org/t/deleting-temporary-files-created-by-cmdstanr/32485

Deleting temporary files created by cmdstanr

I am running cmdstanr within an mclapply loop, e.g. mod <- cmdstan_model(stan_file='myModel.stan') results <-do.call(rbind,mclapply(1:1000,mc.cores=4,function(i) { ... fit <- mod$sample(data=input_data, chains=4, parallel_chains=4) ... }) Stan runs fine but it creates several large files within the rtmpfile /tmp/RtmpXXX and they do not get removed, but actually accumulate as the mclapply loop pro...

The Stan Forums