1. The execution environment for a script is the global environment. Each R script run from a shell will be given its own global environment. Each R session has exactly one global environment, but you can have several active R sessions.
2. Using return in a script instead of a function will throw an error Error: no function to return from, jumping to top level 3. You can use print(), cat(), and writeLines() to write to the output. It does not save your R objects before it exits the script. You could use save() or save.image() to save your objects, or possibly saveRDS() if you are only looking to save one object. You could also use source() if you just want the objects from another script. 4. Will you have shared access to the objects in another R session? No, objects are not shared, unless you've got something weird setup with external pointers. Each session has it owns global environment. 5. Any of the doc pages for the functions I listed above would help, you can also do ?utils::Rscript [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.