Unable to require installed package
On Thu, 27 Jan 2011, Barry Rowlingson wrote:
On Thu, Jan 27, 2011 at 7:57 AM, ??? <liping.liulp at gmail.com> wrote:
Hi, I write a package in Linux and ready to distribute, and I can install it in linux and run it. However, when I have install it in my Windows' R. I can not 'require' it.
is.element("grt", installed.packages()[,1])
[1] TRUE
require(grt)
Loading required package: grt Failed with error: ??'grt' is not a valid installed package? Is there any pitfall between platforms? And anywhere I could check more detailed error message.
How did you install it in Windows? If you just copied it from the Linux install directory, or if its in a shared directory, it probably wont work. You need to do a proper R CMD INSTALL on Windows, and for that you'll need the assorted dev tools for building R packages on Windows.
For the record: these days you do not need any extra tools unless the package contains code that needs compilation, and in the latter case we provide the win-builder service. However, the message indicates no file grt/Meta/package.rds, which would be there if the package was copied from Linux. So we need to know exactly what was done.
Barry
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595