Jim_S
2009-Mar-08 15:19 UTC
[R] Prevent saving the workspace while running a script in batch mode
Dear R-user, I'm running a certain R script in DOS batch mode. Is there a way to prevent R from saving the workspace once this script is finished? I'm asking this because the resulting .RData file has the size of >70MB. I don't need this file since my script already writes the required output and this makes the whole process very slow (>15 minutes each time) FYI, my script: setwd("M:/Program Files/Soskat/Models") library(randomForest) CT <- read.table("CRD.txt",header=TRUE,sep="\t") memory.limit(1000) filename <- paste("CR",read.table("DTE.txt",header=FALSE,sep="\t"),".Rdata",sep="") load(filename) write.table(predict(model, newdata = CT, type = "response"),file="CRP.txt") and my batch line: e:\progra~1\R\bin\R CMD BATCH m:\progra~1\soskat\models\CR.r Thanks in advance, Jim -- View this message in context: http://www.nabble.com/Prevent-saving-the-workspace-while-running-a-script-in-batch-mode-tp22399051p22399051.html Sent from the R help mailing list archive at Nabble.com.
David Winsemius
2009-Mar-08 15:32 UTC
[R] Prevent saving the workspace while running a script in batch mode
?quit # ,save="no" -- DW On Mar 8, 2009, at 11:19 AM, Jim_S wrote:> > Dear R-user, > > I'm running a certain R script in DOS batch mode. Is there a way to > prevent > R from saving the workspace once this script is finished? I'm asking > this > because the resulting .RData file has the size of >70MB. I don't > need this > file since my script already writes the required output and this > makes the > whole process very slow (>15 minutes each time) > > > FYI, my script: > > setwd("M:/Program Files/Soskat/Models") > library(randomForest) > CT <- read.table("CRD.txt",header=TRUE,sep="\t") > memory.limit(1000) > filename <- > paste > ("CR",read.table("DTE.txt",header=FALSE,sep="\t"),".Rdata",sep="") > load(filename) > write.table(predict(model, newdata = CT, type = > "response"),file="CRP.txt") > > > and my batch line: > > e:\progra~1\R\bin\R CMD BATCH m:\progra~1\soskat\models\CR.r > > Thanks in advance, > > Jim > -- > View this message in context: http://www.nabble.com/Prevent-saving-the-workspace-while-running-a-script-in-batch-mode-tp22399051p22399051.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.David Winsemius, MD Heritage Laboratories West Hartford, CT