Question

I want to run a R script again and again from commandline (passing different arguments). At the beginning of the script, I load a saved R workspace. However, the workspace is too large, so it will take a long time to load every time I run the script.

Is there anyway to just load the workspace once for all the run?

Thank you.

Was it helpful?

Solution

Every time you run the script it creates a new R instance, so you will need to reload your environment every time the script runs.

If you want to keep your environment in memory, you might want to create a while loop which reads user input from console or from file and executes the function with new parameters.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top