> > 2) Is there a way to generate platform independent paths? So that 
> > "path/2/input.tbl" on *nix systems becomes "path\2\input.tbl" on a 
> > Windows system?
> 
> R already does that automatically. 

Clarification. R does that automatically _for paths used by R_ (including, on 
my system, the path to command in system(command) ) but NOT for path or file 
arguments supplied to that system command. So R correctly runs cmd.exe when 
specified as system("c:/windows/system32/cmd.exe") but if you wanted to supply 
a path as an  argument R does not know that the argument is a path and wisely 
doesn't treat it as one.

So (on win XP and using R 2.15.3) 
system("c:\\windows\\system32\\cmd /c dir c:\\windows\\system32\\d*.*", 
intern=T)
#and
system("c:/windows/system32/cmd /c dir c:\\windows\\system32\\d*.*", intern=T)
#both work but 
system("c:/windows/system32/cmd /c dir c:/windows/system32/d*.*", intern=T)
        #does not



*******************************************************************
This email and any attachments are confidential. Any use...{{dropped:8}}

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to