Dear All: I have a library for R 1.9.1, it is very easy to setup a library in R 1.9.1. For example: I want to setup a library "test" for R1.9.1. 1. Create a folder "test" in the direct X:\ R\ rw1091\ library \. 2. Create a file "DESCRIPTION" in the direct X:\ R\ rw1091\ library\ test\. 3. Modify the "Package:" and "Title:" item to "test" in the file "DESCRIPTION" . 4.Create a folder "R" in the direct X:\ R\ rw1091\ library\ test\ . 5.Create a file "test" in the direct X:\ R\ rw1091\ library\ test\ R\ . 6. Add all the function into the "test" file. Then I can call the "test" using command " library (test) ". I setup the library using the same way in R2.0.1, but the library can't work. The error message is " Error in library(test) : 'test' is not a valid package -- installed < 2.0.0? " I search the help file and document but still can't upgrade the library. Who can tell me how to upgrade library from R 1.9.1 to R 2.0.1 or give me a sample, thanks. Best Regards YiYao Jiang Product Division/ Product Testing Department Semiconductor Manufacturing International Corporation 18 ZhangJiang Road, PuDong New Area, Shanghai ZIP: 201203 Tel:86-21-5080-2000 Ext. 15173
Gabor Grothendieck
2005-Feb-17 04:26 UTC
[R] How to upgrade library from R 1.9.1 to R 2.0.1
YiYao_Jiang <YiYao_Jiang <at> smics.com> writes: : : Dear All: : : I have a library for R 1.9.1, it is very easy to setup a library in R 1.9.1. : For example: : I want to setup a library "test" for R1.9.1. : 1. Create a folder "test" in the direct X:\ R\ rw1091\ library \. : 2. Create a file "DESCRIPTION" in the direct X:\ R\ rw1091\ library\ test\. : 3. Modify the "Package:" and "Title:" item to "test" in the file "DESCRIPTION" . : 4.Create a folder "R" in the direct X:\ R\ rw1091\ library\ test\ . : 5.Create a file "test" in the direct X:\ R\ rw1091\ library\ test\ R\ . : 6. Add all the function into the "test" file. : Then I can call the "test" using command " library (test) ". : I setup the library using the same way in R2.0.1, but the library can't work. : The error message is " Error in library(test) : 'test' is not a valid package -- installed < 2.0.0? " : I search the help file and document but still can't upgrade the library. : Who can tell me how to upgrade library from R 1.9.1 to R 2.0.1 or give me a sample, thanks. I assume you are referring to a package that you wrote and want to upgrade. I think there may be confusion here between the source and installed package. The source package is what you wrote and it should _not_ go into \R\rw2001\library\test. Lets say we put that in \Rpkgs\test . Then, assuming you just installed R 2.0.1, use the Rcmd.exe program to install the source package into your R tree. cd \Rpkgs \R\rw2001\bin\Rcmd install test to install it. Fix up any errors you get during the install and repeat until it installs. Now go into R and test it out. If it seems to work try running 'Rcmd check' on it: cd \Rpkgs \R\rw2001\bin\Rcmd check test and fix up any errors and repeat until it passes Rcmd check and reinstall. See the Writing Extensions Manual if the above is not sufficient.
Prof Brian Ripley
2005-Feb-17 07:58 UTC
[R] How to upgrade library from R 1.9.1 to R 2.0.1
This is both in the NEWS file and in the rw-FAQ (you are on Windows, I believe, but have not mentioned it). You absolutely must install packages properly (with R CMD INSTALL) on R 2.0.1. What you did has never to my knowledge been documented, and often did not work under 1.9.1, so you were fortunate. You will find it easier to find the pertinent information if you search for the concept `package' (you are talking about a package) under `package' not `library'. See 3.1 Can I install packages into libraries in this version? Yes, but you will need a lot of tools to do so, unless the author or the maintainers of the `bin/windows/contrib' section on CRAN have been kind enough to provide a pre-compiled version for Windows as a `.zip' file. ... On Thu, 17 Feb 2005, YiYao_Jiang wrote:> I have a library for R 1.9.1, it is very easy to setup a library in R 1.9.1. > For example: > I want to setup a library "test" for R1.9.1. > 1. Create a folder "test" in the direct X:\ R\ rw1091\ library \. > 2. Create a file "DESCRIPTION" in the direct X:\ R\ rw1091\ library\ test\. > 3. Modify the "Package:" and "Title:" item to "test" in the file "DESCRIPTION" . > 4.Create a folder "R" in the direct X:\ R\ rw1091\ library\ test\ . > 5.Create a file "test" in the direct X:\ R\ rw1091\ library\ test\ R\ . > 6. Add all the function into the "test" file. > Then I can call the "test" using command " library (test) ". > I setup the library using the same way in R2.0.1, but the library can't work. > The error message is " Error in library(test) : 'test' is not a valid package -- installed < 2.0.0? " > I search the help file and document but still can't upgrade the library. > Who can tell me how to upgrade library from R 1.9.1 to R 2.0.1 or give me a sample, thanks.-- 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