.Platform addition (was Re: [R] where does R search when source()?)

From: Paul Roebuck <roebuck_at_odin.mdacc.tmc.edu>
Date: Tue 13 Jul 2004 - 02:01:49 EST


On Sun, 11 Jul 2004, Gabor Grothendieck wrote:

> search.path <-
> function(fn,
> paths = strsplit(Sys.getenv("PATH"), split = ";")[[1]],
> fsep = "\\") {
> for(d in paths) {
> f <- file.path(d, fn, fsep = fsep)
> if (file.exists(f))
> return(f)
> }
> return(NULL)
> }
>
> source(search.path("myscript.R"))

I glanced this and thought this might be handy to keep for possible use. To make it less Windows-specific, I was going to replace Gabor's fsep default value with '.Platform$file.sep' when I noticed that .Platform doesn't have a '$path.sep' field. Just missing or available elsewhere?



SIGSIG -- signature too long (core dumped)

R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Tue Jul 13 02:08:39 2004

This archive was generated by hypermail 2.1.8 : Fri 18 Mar 2005 - 02:35:38 EST