[R] Convert windows source package for Mac use

Marc Schwartz marc_schwartz at me.com
Tue Feb 24 14:51:45 CET 2015


> On Feb 24, 2015, at 7:19 AM, Warthog <arjarvis.warthog at gmail.com> wrote:
> 
> Hi, 
> I am on a Mac. 
> Is there a way to convert a Windows source package so it can be installed on a Mac?
> 
> I have a package in zip form from a friend who runs Windows. 
> I THINK that it is in compiled format for Windows. 
> The Description says: 
> Built: R 3.1.2 x86_64-w64-mingw32....windows 
> 
> I tried to convert it to a tgz then Install/Load on Mac R, but I get the error message: 
> Error: package 'package' was built for x86_64-w64-mingw32 
> 
> I can run Windows on Parallels Desktop, and the original zip format installs and loads OK. 
> 
> I'd prefer to run R on my Mac. 
> Sorry if this is a stupid question: I read the R-exts and it doesn't say if you can or cannot do this. 
> 
> Thanks, 
> Alan 


Hi,

Just as an FYI, there is a Mac specific SIG list:

  https://stat.ethz.ch/mailman/listinfo/r-sig-mac

Next, the Windows .zip file is a *binary*, not source package, specifically compiled for Windows, as you hint at above. If the package contains any C/C++/FORTRAN code, then that code is also compiled for Windows and is not portable.

The source package would/should have a .tar.gz extension and you would want your friend to provide that version of his/her package, presuming that he/she created this package and that it is not otherwise available (eg. from CRAN or a third party location). 

If you can get that version of the package, then you may be able to install it on OS X, using:

  install.packages(PackageFileName, repos = NULL, type = "source")

That presumes that there is no C/C++/FORTRAN code that requires compilation. If so, you would also need to install required development related tools which are referenced in the R FAQ for OSX and the Installation and Admin manual.

Regards,

Marc Schwartz



More information about the R-help mailing list