setwd("output") files <- list.files() pv <- unlist(lapply(files,readRDS)) cat(sprintf( "Gathered estimate p=%g\n",mean(pv)))