2

I'm trying to use the legacy version of R to run a package on Mac.

On Windows there is a switch in the General tab. However, it is not found on Mac RStudio. I referred to this post: https://support.rstudio.com/hc/en-us/articles/200486138-Using-Different-Versions-of-R

And I do not quite understand the 3 options:

  1. Run the installer from CRAN for the R version you want to be current
  2. List item Use the RSwitch utility available at: http://r.research.att.com/
  3. Update the R.framework/Versions/Current directory alias directly using ln -s

Especially for RSwitch utility, how do I even open/use that?

Thanks!

lydias
  • 841
  • 1
  • 14
  • 32
  • You need to be more specific about version numbers and setup if you want code. Rstudio installed 3.2.? when I first installed it, despite being in the 3.5 era. The RSwitch utility is specific for using the package R.app GUI. It assumes a particular location for the executables. You should say what happened when you tried to install RSwitch. – IRTFM Nov 20 '18 at 00:59
  • @42- I'm trying to install version R 2.6 on my mac. I tried to download on R site, but I can't even install the package. What I'm trying to do is to run the code in this research paper: https://www.jstatsoft.org/article/view/v024i05. Some of the features of the package latenent are no longer available in the current version. The paper used latentnet version 2.1.1 – lydias Nov 20 '18 at 01:03
  • Versions!!!! We need full accounting of versions. I seriously doubt that you can install R 2.11 on Mojave for instance. I also doubt that there would be any benefit in doing so. That is a version that is almost 10 years old. – IRTFM Nov 20 '18 at 01:04
  • @42 I'm trying to install R 2.6.1 which released during the same time when package latentnet 2.1.1 was released. – lydias Nov 20 '18 at 01:06
  • @hrbrmstr ; Docker is powerful enough to "rewind time" back to OSX Leopard and R 2.6? – IRTFM Nov 20 '18 at 02:54
  • @hrbrmstr Maybe going to find a PC in the library to run the code could be easier? – lydias Nov 20 '18 at 02:57
  • 1
    @lydias Perhaps a less painful and faster route would be to file an issue at the package's [GitHub repository](https://github.com/statnet/latentnet), explain what you are trying to do, what isn't working, provide specific code examples that don't work and see if the maintainer can provide assistance. I tried doing surgery on the 2.1.1 archive source to get it to work with a more modern R but there are enough "gotchas" and _so many dependencies_ that I would be wary of using it even if I could get it to a working build. – hrbrmstr Nov 20 '18 at 11:35
  • 1
    @lydias Per my (now deleted to prevent a comment conversation warning) Docker suggestion. You're not getting R 2.6 to run on a modern Mac. You *can* get it running in Linux. You can use free tools like VirtualBox (ignore Docker for now) to install Linux into a VM, build R from source (painful if not used to such things), collect _all_ the cascading proper versions of all the archived package dependencies for latentnet 2.1.1 (all are on CRAN in source form) and try to build it. That sounds far more painful than reaching out to someone on GitHub. – hrbrmstr Nov 20 '18 at 11:41
  • @hrbrmstr thank you for taking the time looking into the problem. I think I will consider using VirtualBox. It seems to be the most efficient method at this point. – lydias Nov 20 '18 at 19:25

1 Answers1

1

This old question is again timely, with the move to R version 4.

There is an RSwitch.app available for MacOS 10.14+ that provides this functionality via a menu bar app. You can choose which of your R builds to use, integrating with the standard Mac GUI and with RStudio. (I've had trouble with the newest Mac GUI not working with R 3.6.3 but RStudio seems to work fine with both that and R 4.0.1 along with this RSwitch.app.) The help pages for Rswitch show what's going on underneath, if you prefer to work via a command line.

If you use a standard .pkg via GUI to install a newer version of R it will effectively forget the other versions. You can use the command

pkgutil --forget (path to package name)

with the .pkg to overcome that. (I've had trouble installing from a tarball instead; might just be my incompetence.) Installing an older version from a .pkg won't overwrite a newer version but in that case it might be safest to omit any attempt to instal older Tcl/Tk and Texinfo, selectable with the "Customize" button at the "Installation Type" stage of the installation. With security settings in MacOS you might have trouble opening some R .pkg files; the awkward workaround is to use Control/right/two-finger click on the file in the Finder, then select ‘Open With’ and ‘Installer’ from the menu that appears.

The version of RSwitch.app noted in the question is still available via a link from this page. This is evidently 32-bit as it is disabled on my Mac under OS 10.14.

EdM
  • 405
  • 4
  • 11