[R] path for source()

Wolfgang Raffelsberger wraff at titus.u-strasbg.fr
Thu Feb 8 09:50:49 CET 2007


Hi,
an easy way to address this is to change directory within R before 
calling source() :
setwd("D:/Projects/yourProject")
source("yourCode.R")

Of course you need to know where your .R files are.
Using getwd() you can always check where you are and using dir() you can 
check the files in your directory (which you could combine with grep() 
to search for ".R") ..

Wolfgang

colliera at ukzn.ac.za a écrit :
> hello,
>
> i have a couple of .R files distributed about my file system. i commonly source() these from other files, but i have to include the full file path. this is not always convenient if you move files around. is there a way of setting the search path for source()?
>
> thanks a lot!
>
> cheers,
> andrew.
>
>   


-- 

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 
. . . . .

Wolfgang Raffelsberger, PhD
Laboratoire de BioInformatique et Génomique Intégrative
IGBMC
1 rue Laurent Fries,  67404 Illkirch  Strasbourg,  France
Tel (+33) 388 65 3300         Fax (+33) 388 65 3276
wolfgang.raffelsberger at igbmc.u-strasbg.fr



More information about the R-help mailing list