Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R help files on different OS

Is there some way to access the Windows version of a helpfile on a Linux computer within R?

I write a decent amount of R code on my Linux machine, but I do have to make sure the code will run on a Windows machine for collaborators.

I've been burned a number of times by reading a help file on my Linux machine, writing my code, and then spending hours wondering why it's not working on the Windows machine until I check the helpfile on that machine and realise that it is different to the one on the Linux machine.

It'll usually have a "NOTE: On Windows, xxxx behaves differently...", and I wish I knew that while I was writing the code on my Linux machine!

I do realise that many help files are system-specific (for example ?system), but sometimes I would like to read the Windows version on my Linux computer. Today I found myself wanting to read ?windows but had to boot up my Windows laptop just to read that helpfile, because that function isn't available on Linux and so there's no help file.

cheers.

like image 576
mathematical.coffee Avatar asked Mar 13 '12 01:03

mathematical.coffee


1 Answers

You can always look at the source which gives you clear conditionals -- this is from man/system.Rd:

#ifdef windows
  Only double quotes are allowed on Windows: see the examples.  (Note: a
  Windows path name cannot contain a double quote, so we do not need to
  worry about escaping embedded quotes.)

  [...]

#endif
#ifdef unix
  Unix-alikes pass the command line to a shell (normally \file{/bin/sh},
  and POSIX requires that shell), so \code{command} can be anything the
  shell regards as executable, including shell scripts, and it can
  contain multiple commands separated by \code{;}.

  [...]

#endif
like image 113
Dirk Eddelbuettel Avatar answered Oct 13 '22 20:10

Dirk Eddelbuettel