[R] How to do platform independent system calls?

S Ellison S.Ellison at LGCGroup.com
Tue Apr 2 13:30:28 CEST 2013


> -----Original Message-----
> 1) Is there a way to implement such calls to external tools, 
> so they become platform independent? I mean, so that these 
> calls will work both on a *nix and a Windows system?
No - at least, not generally, for the more or less obvious reason that *nix tools are not generally present on Windows.
But if you have a system call with _exactly_ the same name and options it should work (windows isn't case-sensitive for system calls/tools; unix is)
Under windows, too, constructing batch files with suitable names (eg 'ls.bat') can go some way to making unix-like things at least run windows equivalents. But you'd have to do a lot of work to get identical output.

> 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. 

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

More information about the R-help mailing list