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 = "")
}
}
}
网友评论