Skip to content
Prev 17285 / 398513 Next

system-independent path for source()

That looks good, except the hard disk name should be kept separate from 
the user-specified path. Otherwise, a call from MacOS that uses an 
absolute path will not work on UNIX.

I suggest modifying your file.path interface:
file.path<-function (..., fsep = .Platform$file.sep,absolute=FALSE, 
hard.disk.name = "C") {}

If .Platform$OS.type=="mac" and absolute, then hard.disk.name would be 
added to the beginning of the path.

This way, file.path("Users","thomas",absolute=TRUE, hard.disk.name = 
"Macintosh HD") would work for both MacOS and UNIX. I think this 
interface could also be made to work with Windows.
On Wednesday, February 20, 2002, at 04:32 ?, Thomas Lumley wrote:

            
http://www.mcg.edu/research/biostat/bickel.html

David R. Bickel, PhD
Assistant Professor
Medical College of Georgia
Office of Biostatistics and Bioinformatics
1120 Fifteenth St., AE-3037
Augusta, GA 30912-4900

Tel.: 706-721-4697; Fax: 706-721-6294
E-mail: dbickel at mail.mcg.edu or bickel at prueba.info

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._