rm(list=ls()) lapply( paste('package:',names(sessionInfo()$otherPkgs), sep="" ), FUN=detach , character.only=TRUE , unload=TRUE ) are useful calls to ensure the independence of a script run in a series of scripts. Let's say the first scripts update data for later scripts depending on switches in a SourcingScript (a script just calling other scripts).
Looks neat! Just not sure if Jenny Bryan would like it ... rmarkdown scripts run, by default, in their own session. Getting a new session "for free" somehow feels better than mimicking it by removing all objects from the environment and unloading packages.
rm(list=ls())
lapply( paste('package:',names(sessionInfo()$otherPkgs), sep="" ), FUN=detach , character.only=TRUE , unload=TRUE )
are useful calls to ensure the independence of a script run in a series of scripts. Let's say the first scripts update data for later scripts depending on switches in a SourcingScript (a script just calling other scripts).
Looks neat!
Just not sure if Jenny Bryan would like it ...
rmarkdown scripts run, by default, in their own session. Getting a new session "for free" somehow feels better than mimicking it by removing all objects from the environment and unloading packages.
@@StatistikinDD interesting since I do not use rmd enough but rather just R files
awesome....