Jiqiang Guo <guojq28 <at> gmail.com> writes: > As we know when we use R to execute a r program we can add arguments like > '--args p1 p2'. But when I am sourcing another file, is there a way to set > up some arguments for the sourced program. Thanks! >
In general, you can use Sys.getenv() and .setenv() to pass parameters from the command line. passw=Sys.getenv("PASSW") But when sourcing, why not simply use R? mypass = "secret" source("myfile.r") Dieter ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.