[R] Evaluating code in a sandbox

lederer@trium.de lederer at trium.de
Mon Jan 31 02:10:10 CET 2005


Dear R-Gurus,

is it possible to evaluate foreign R code in such a safe way, that it has
no chance to confuse the global environment?

The follwing does not suffice, because the untrusted code might e.g.
contain a superassignment ("<<-"):

connection <- textConnection(some.untrusted.code)
try(eval(parse(connection), envir=new.env()))
close(connection)


Christian




More information about the R-help mailing list