Skip to content
Prev 386960 / 398502 Next

Why is rm(list=ls()) bad practice?

I think it's always difficult and sometimes impossible to take an 
existing session and convert it to the vanilla state, but it's very easy 
to run a new instance of R from an existing one.

So instead of a clearws() function, I'd suggest a "runInVanilla" 
function, that takes some code as input, starts up a vanilla session and 
collects the output.

This is quite similar to what reprex::reprex does, maybe not different 
at all.

Duncan Murdoch
On 22/01/2021 10:37 a.m., J C Nash wrote: