[R] The steps of building library in R 2.1.1
drewbrewit at yahoo.com
Sat Jul 23 00:32:43 CEST 2005
Agreed, It takes a lot of work for one to create
his/her first package. And
there are many opportunities to get it wrong.
I just created my first package, with thanks to Gabor,
Peter Rossi (and his
excellent document at
ng%20R%20Packages%20Under%20Windows.pdf ), and the
guys who developed
could not have done it without them!!!
And lastly thanks to all of those who have developed R
and worked on this
great program over the years!
From: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch]On Behalf Of
Sent: Thursday, July 21, 2005 5:43 AM
To: Uwe Ligges
Cc: r-help at stat.math.ethz.ch; Ivy_Li
Subject: Re: [R] The steps of building library in R
I think you have been using R too long. Something
this is very much needed. There are two problems:
1. the process itself is too complex (need to get rid
integrate package development tools with package
procedure [it should be as easy as downloading a
remove necessity to set or modify any environment
including the path variables).
2. there is too much material to absorb just to create
The manuals are insufficient.
A step-by-step simplification is very much needed.
coincidence that there are a number of such
the net (google for 'making creating R package') since
guess that just about everyone has significant
problems in creating
their first package on Windows.
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
> > 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
> > 1. Read the webpage
> Do you mean
> > 2. Download the "rw2011.exe"; Install the newest
version of R
> > 3. Download the "tools.zip"; Unpack it into
> Not required to call it "cygwin" - also a bit
> > 4. Download the
"ActivePerl-22.214.171.1243-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
> Why in c:\mingwin ?
> > 6. Then go to "Control Panel -> System -> Advanced
Variables -> Path -> Variable Balue"; add
> > 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
> 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
> > 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
> > 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"),
> > 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:
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
> 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
> 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
> > cd \Program Files\R\rw2010
> > bin\R CMD INSTALL "/Program
> I do not see why anybody would like to contaminate
> installation of R with some development source
> 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
> omitting some relevant information, I guess we got
something that is
> misleading if the reader does NOT read the manuals
> 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
> > 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
> > Formats: text html latex example chm
> > d text
> > e text
> > f text
> > g text
> > 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)
> > #18 ZhangJiang Road, PuDong New Area, Shanghai,
> > 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!
> R-help at stat.math.ethz.ch mailing list
> PLEASE do read the posting guide!
Stay connected, organized, and protected. Take the tour:
More information about the R-help