hpcCombiner <- function(path, filePatterns, datPatterns = NULL, remPattern = c("_part","_0") ,clear = T)
{
fnEnv <- environment()
#obtain all files in directory
lsDir <- dir(path = path)
#filter by given patterns
lsDir <- sapply(filePatterns, lsDir, value=T)
#add path to filename
lsDir <- past0(path, "/", lsDir)
#read in all files listed
lapply(lsDir, load, envir = fnEnv)
if(is.null(datPatterns)|| is.na(datPatterns))
{
cat("No datPatterns was defined, filePatterns is used instead")
datPatterns <- filePatterns
}
lstoComb <-ls()
lstoComb <- sapply(datPatterns, lstoComb, value=T)
assign(x = ) = NULL
for(re in lstocomb){
res_gamma_cent_kde_46 <- c(res_gamma_cent_kde_46, get(re))
rm(list = re)
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.