Are there system-specific features of R?

My employees would like to make sure that our work in R is platform independent, in particular, this code will work on Linux, Mac and Windows, and files created on one system will work on other systems.

Since the problem arose earlier in my group, I would be grateful for a general answer that will make it easier for me to convince my co-authors that there will be no problems. For example, it would help to have a link other than "because (the subject expert) said so on SO."

  • Typically, is there a way to find out if any R functions are platform specific (can I assume this will be indicated in the help of the function)?
  • Are there packages or features that I can be sure of that will be platform independent?
  • Are there types of packages or features that I should worry about?

Earlier I asked two questions about cross-platform readability of files created by R: What are the disadvantages of using .Rdata files compared to HDF5 or netCDF? and Are R objects dumped using the readable cross-platform `dump`?

+6
source share
3 answers

Aside from Carl's answer, the obvious way to make sure your work is platform-independent validation on all platforms.

This is exactly what CRAN does with its 3800+ packages, and you have access to the logs here .

In short, R is really trying hard to be platform independent and basically succeeds. To do this with your code, it's up to you to avoid APIs or tools that introduce dependencies. Look at abstractions such as system.file(package="boot") and the functions they use --- you can easily abstract the "roots" of the file system, and the delimiters have already taken care.

+4
source

Check cran.r-project.org for a list of packages. Each package has a page that tells you whether it passed the test for different operating systems. Also, as you said, help files are pretty explicit regarding OS dependencies. R is smart enough to translate "/" to "\" along the way for those poor Windows people. Generally speaking, graphical access is an area that most likely has platform dependencies. Obviously, if you are missing the {X11, ImageMagick, ..} system, you are still stuck.

+2
source

In addition to the comments of Karl and Dirk, you should understand that any package that requires compilation from the source (like many (all?) Packages that are on Omegahat, Rforge or r-forge) must be executed on a machine that has the correct ones C and Fortran libraries. Some interesting packages depend on GTK + and Tcl / Tk, and you may need to make sure that you can get the correct versions. The http://r.research.att.com/ page hosted by Simon Urbanek is a useful resource for supporting resources for Mac computers.

+2
source

Source: https://habr.com/ru/post/917198/


All Articles