################################################################################## ################################################################################## ################################################################################## # An R script to merge the results of a batch job run in R Studio with the # Agave cluster. Run it in the same directory you ran the original job in. # # Author: Sherry Towers # smtowers@asu.edu # Created: Feb 19, 2019 # # Copyright Sherry Towers, 2019 # # This script is not guaranteed to be free of bugs and/or errors # # This script can be freely used and shared as long as the author and # copyright information in this header remain intact. ################################################################################## setwd("registry") setwd("results") a = list.files() for (i in 1:length(a)){ if (i==1){ merged_data = as.data.frame(readRDS(a[1])) }else{ merged_data = rbind(merged_data,as.data.frame(readRDS(a[i]))) } } setwd("../../") cat("The names in the merged data frame are:",names(merged_data),"\n") write.table(merged_data,"./merged_results.csv",sep=",",row.names=F)