Re: [R] Accessing scripts in a different directory on a Mac

2007-10-26 Thread Charilaos Skiadas
You could simply create your own function, to avoid repeating the paste part each time: scriptdir <- path.to.scripts my.source <- function(file) { source(file.path(scriptdir,file)) } my.source("file.r") my.source("anotherfile.r") ... (You'll have to watch out for correct number of slash

Re: [R] Accessing scripts in a different directory on a Mac

2007-10-25 Thread Tim Calkins
consider something along the lines of: >scriptdir <- '/path/to/scripts/" >source(paste(scriptdir,'subscript.r',sep='')) alternatively, you could try: >workdir <- getwd() >scriptdir <- '/path/to/scripts/" >setwd(scriptdir) >source('subscript.r') >setwd(workdir) cheers, tim On 10/26/07, Br

[R] Accessing scripts in a different directory on a Mac

2007-10-25 Thread Bryan Hanson
Hi all. A question for knowledgeable folks using R on an Intel Mac running OS X 10.4.10 For ease of maintenance, I have broken a large R script into a main script which ³oversees² things by calling other scripts, using ³source². Let¹s call the secondary scripts ³sub-scripts.² I¹d like for the s