I have written a very basic package in R. In fact, I followed this tutorial for creating a basic package.
My package works just fine in linux. eg:
> install.packages("linmod", repos=NULL) Warning in install.packages("linmod", repos = NULL) : argument 'lib' is missing: using '/home/jpgoel/R/i486-pc-linux-gnu-library/2.9' * Installing *source* package ‘linmod’ ... ** R ** data ** preparing package for lazy loading ** help *** installing help indices >>> Building/Updating help pages for package 'linmod' Formats: text html latex example ** building package indices ... * DONE (linmod) > library(linmod) > data(mod1) > mod1 Call: linmod.default(x = x, y = y) Coefficients: Const Bwt -0.3566624 4.0340627
Now, I took my "linmod" folder, copied it to Windows XP, and tried the following:
> install.packages("C:\\Documents\ and\ Settings\\foo\\Desktop\\linmod",repos=NULL) Error in gzfile(file, "r") : cannot open the connection In addition: Warning messages: 1: In unzip(zipname, exdir = dest) : error 1 in extracting from zip file 2: In gzfile(file, "r") : cannot open compressed file 'linmod/DESCRIPTION', probable reason 'No such file or directory' >
Okay. So then I took that folder and placed it into a .zip file. Then I went to Packages -> Install package(s) from local zip files... and selected my package.
> utils:::menuInstallLocal() updating HTML package descriptions > library(linmod) Error in library(linmod) : 'linmod' is not a valid installed package
I'm stumped. My package doesn't have any native code (eg, no extensions written in C.)
Feel free to download the .zip from here (the link to download is all the way at the bottom, "Save file to your PC")