My memory is getting clogged by a bunch of intermediate files (call them temp1, temp2, etc). Is it possible to remove them from memory without doing rm(temp1),
rm(temp1)
Or using regular expressions
"rmlike" <- function(...) { names <- sapply( match.call(expand.dots = FALSE)$..., as.character) names = paste(names,collapse="|") Vars <- ls(1) r <- Vars[grep(paste("^(",names,").*",sep=""),Vars)] rm(list=r,pos=1) } rmlike(temp)