[R] The steps of building library in R 2.1.1
murdoch at stats.uwo.ca
Thu Jul 21 17:23:54 CEST 2005
On 7/21/2005 9:43 AM, Gabor Grothendieck wrote:
> I think you have been using R too long. Something like
> this is very much needed. There are two problems:
> 1. the process itself is too complex (need to get rid of perl,
> integrate package development tools with package installation
> procedure [it should be as easy as downloading a package],
> remove necessity to set or modify any environment variables
> including the path variables).
I agree with some of this, but I don't see much interest in fixing it.
For example, getting rid of Perl would be a lot of work. When the Perl
scripts were written, R was not capable of doing what they do. I think
it is capable now, but there's still a huge amount of translation work
to do. Who will do that? Who will test that they did it right? At the
end, will it actually have been worth all the trouble? Installing Perl
is not all that hard.
> 2. there is too much material to absorb just to create a package.
> The manuals are insufficient.
The first sentence here is basically a repetition of "the process is too
complex". I think the second sentence is incorrect. Could you please
point out what necessary steps are missing?
> A step-by-step simplification is very much needed.
Exactly this has been in the Installation and Administration manual
since I put it there in February for the 2.1.0 release. It's at the
beginning of the appendix on the Windows toolset, with multiple
references pointing people there. It's followed by detailed
descriptions of each of the steps.
If you think it could be further improved, please submit improvements.
> coincidence that there are a number of such descriptions on
> the net (google for 'making creating R package') since I would
> guess that just about everyone has significant problems in creating
> their first package on Windows.
As far as I can tell, those all predate the release of 2.1.0. I think
your complaints are out of date.
> On 7/21/05, Uwe Ligges <ligges at statistik.uni-dortmund.de> wrote:
>> Ivy_Li wrote:
>> > Dear All,
>> > With the warm support of every R expert, I have built my R library successfully.
>> > Especially thanks: Duncan Murdoch
>> > Gabor Grothendieck
>> > Henrik Bengtsson
>> > Uwe Ligges
>> You are welcome.
>> The following is intended for the records in the archive in order to
>> protect readers.
>> > Without your help, I will lower efficiency.
>> > I noticed that some other friends were puzzled by the method of building library. Now, I organize a document about it. Hoping it can help more friends.
>> > 1. Read the webpage <http://www.stats.ox.ac.uk/pub/Rtools>
>> Do you mean http://www.murdoch-sutherland.com/Rtools/ ?
>> > 2. Download the "rw2011.exe"; Install the newest version of R
>> > 3. Download the "tools.zip"; Unpack it into c:\cygwin
>> Not required to call it "cygwin" - also a bit misleading...
>> > 4. Download the "ActivePerl-126.96.36.1993-MSWin32-x86.msi"; Install Active Perl in c:\Perl
>> Why in C:\Perl ?
>> > 5. Download the "MinGW-3.1.0-1.exe"; Install the mingw32 port of gcc in c:\mingwin
>> Why in c:\mingwin ?
>> > 6. Then go to "Control Panel -> System -> Advanced -> Environment Variables -> Path -> Variable Balue"; add "c:\cygwin;c:\mingwin\bin"
>> > The PATH variable already contains a couple of paths, add the two given above in front of all others, separated by ";".
>> > Why we add them in the beginning of the path? Because we want the folder that contains the tools to be at the beginning so that you eliminate the possibility of finding a different program of the same name first in a folder that comes prior to the one where the tools are stored.
>> OK, this (1-6) is all described in the R Administration and Installation
>> manual, hence I do not see why we have to repeat it here.
>> > 7. I use the package.skeleton() function to make a draft package. It will automate some of the setup for a new source package. It creates directories, saves functions and data to appropriate places, and creates skeleton help files and 'README' files describing further steps in packaging.
>> > I type in R:
>> > >f <- function(x,y) x+y
>> > >g <- function(x,y) x-y
>> > >d <- data.frame(a=1, b=2)
>> > >e <- rnorm(1000)
>> > >package.skeleton(list=c("f","g","d","e"), name="example")
>> > Then modify the 'DESCRIPTION':
>> > Package: example
>> > Version: 1.0-1
>> > Date: 2005-07-09
>> > Title: My first function
>> > Author: Ivy <Ivy_Li at smics.com>
>> > Maintainer: Ivy <Ivy_Li at smics.com>
>> > Description: simple sum and subtract
>> > License: GPL version 2 or later
>> > Depends: R (>= 1.9), stats, graphics, utils
>> > You can refer to the web page: http://cran.r-project.org/src/contrib/Descriptions/ There are larger source of examples. And you can read the part of 'Creating R Packages' in 'Writing R Extension'. It introduces some useful things for your reference.
>> This is described in Writing R Extension and is not related to the setup
>> of you system in 1-6.
>> > 8. Download hhc.exe Microsoft help compiler from somewhere. And save it somewhere in your path.
>> > I download a 'htmlhelp.exe' and setup. saved the hhc.exe into the 'C:\cygwin\bin' because this path has been writen in my PATH Variable Balue.
>> > However if you decided not to use the Help Compiler (hhc), then you need to modify the MkRules file in RHOME/src/gnuwin32 to tell it not to try to build that kind of help file
>> This is described in the R Administration and Installation manual
>> and I do not see why we should put the html compiler to the other tools.
>> > 9. In the DOS environment. Into the "D:\>" Type the following code:
>> There is no DOS environment in Windows NT based operating systems.
>> > cd \Program Files\R\rw2010
>> > bin\R CMD INSTALL "/Program Files/R/rw2011/example"
>> I do not see why anybody would like to contaminate the binary
>> installation of R with some development source packages.
>> I'd rather use a separate directory.
>> I think reading the two mentioned manuals shoul be sufficient. You have
>> not added relevant information. By adding irrelevant information and
>> omitting some relevant information, I guess we got something that is
>> misleading if the reader does NOT read the manuals as well.
>> Uwe Ligges
>> > Firstly, because I install the new version R in the D:\Program Files\. So I should first into the D drive. Secondly, because I use the package.skeleton() function to build 'example' package in the path of D:\Program Files\R\rw2011\ So I must tell R the path where saved the 'example' package. So I write the code is like that. If your path is different from me, you should modify part of these code.
>> > 10.Finally, this package is successfully built up.
>> > ---------- Making package example ------------
>> > adding build stamp to DESCRIPTION
>> > installing R files
>> > installing data files
>> > installing man source files
>> > installing indices
>> > not zipping data
>> > installing help
>> > >>> Building/Updating help pages for package 'example'
>> > Formats: text html latex example chm
>> > d text html latex example
>> > e text html latex example
>> > f text html latex example
>> > g text html latex example
>> > adding MD5 sums
>> > * DONE (example)
>> > I was very happy to get the great results. I hope the document can help you. Thank you again for everyone's support.
>> > Best Regards!
>> > Ivy Liï¼æçï¼
>> > YMS in Production & Testing
>> > Semiconductor Manufactory International(ShangHai) Corporation
>> > #18 ZhangJiang Road, PuDong New Area, Shanghai, China
>> > Tel: 021-5080-2000 *11754
>> > Email: Ivy_Li at smics.com
>> > ------------------------------------------------------------------------
>> > ______________________________________________
>> > R-help at stat.math.ethz.ch mailing list
>> > https://stat.ethz.ch/mailman/listinfo/r-help
>> > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>> R-help at stat.math.ethz.ch mailing list
>> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
> R-help at stat.math.ethz.ch mailing list
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
More information about the R-help