[R] Running code sequentially from separate scripts (but not functions)

Dimitri Liakhovitski dimitri.liakhovitski at gmail.com
Thu Feb 24 16:21:47 CET 2011


Hello!

I am wondering if it's possible to run - in sequence - code that is
stored in several R scripts.
For example:

Script in the file "code1.r" contains the code:
a = 3; b = 5; c = a + b

Script in the file "code2.r" contains the code:
d = 10; e = d - c

Script in the file "code3.r" contains the code:
result=e/a

I understand that I could write those 3 scripts as 3 functions and
source them from another script.
But maybe there is a way of having them run one by one as such?

Thanks a lot!

-- 
Dimitri Liakhovitski
Ninah Consulting
www.ninah.com



More information about the R-help mailing list