0. 情景
當R語言在處理大數據過程中,內存/CPU超載而導致報錯的嘗試處理方案
1. Core function
rm(list= ls())
.rs.restartR(afterRestartCommand = "")
2. Schemwork
outter_control_fun<-function(){
source('all related self-defined functions')
library('all related R packages')
while(condtion){
ret<- try(execute_fun(), silent = T)
if(class(ret) == 'try-error'){
rm(list = ls())
source('all related self-defined functions')
library('all related R packages')
setup input variables
.rs.restartR(afterRestartCommand = "")
}
}
}