[R] instal tar.gz package on windows

Stefan Evert stefan.evert at uos.de
Thu Jul 31 23:28:06 CEST 2008


> Dear HelpeRs,
> I have created a tar.gz package (the package was created on unix)  
> and I would like to install it in R on a Windows operating system.
> As far as I know, R in Windows accepts only packages in zip file for  
> installation and I could not find a way to install a tar.gz file.
> I would like to mention that I  installed the package on unix using  
> install.packages and it works. I also tried to decompress the tar.gz  
> file and create a zip file but the installation of the resulting zip  
> files gives me errors.

If your package doesn't contain any compiled C code (or link against  
external libraries), simply unpacking the binary .tar.gz package (I've  
done this on a Mac, but Linux/Unix should work just as well) and re- 
packing it as a .zip archive worked for me.  Two caveats:

  - make sure that the ZIP archive is just named  
<package>_<version>.zip, otherwise R might think it's for a different  
version or operating system and may refuse to install it
  - you won't get proper Windows help pages for the functions in the  
package, only the ASCII versions; last time I tried this, they worked  
fine (on R for Windows 2.5.1), at least if called from the command-line

I know this doesn't build a proper package, but it's a quick solution  
without having to set up a Windows machine or a cross-building  
environment. Once the package is reasonably mature, you can simply  
upload it to CRAN and let the wonderful people there build the Windows  
binary for you. :-)


Best regards,
Stefan Evert

[ stefan.evert at uos.de | http://purl.org/stefan.evert ]



More information about the R-help mailing list