[R] source problem

John Hayes jahaye at wm.edu
Mon Jan 12 17:25:24 CET 2004


Hi,

I'm trying to call an R script from the command-line ("firstScript.r"
below).  This script then sources another script in another directory
using the absolute path to the file
("/home/john/R_script/secondScript.r").  That script then needs to
source an R script in the same directory using a relative path
("thirdScript.r").   Neither script should know that it is being
sourced.  For example,

/usr/local/algo/R/script/firstScript.r 
/home/john/R_script/secondScript.r
/home/john/R_script/thirdScript.r

However, I am getting a message that this last file cannot be found. 
I've changed the chdir and local attributes of source to TRUE and this
does not seem to change the behavior.  Is there a way to do this without
passing the absolute path to the R files around?  Thanks for any help
you can offer.

John




More information about the R-help mailing list