Skip to content
Prev 14329 / 63424 Next

Questions on package creation

Gabor,

Here are my takes on these:

1: Not that I know of.  Only the package developer(s) see the code this way,
and is really not different from 3.  (A developer would not need 3, as R CMD
check can be done with 1.)

2 & 4: As Uwe said, the location is `whereever you like'.  You would create
them only for distribution (i.e., installation on other machines), so it
doesn't matter where it put them.  They only exist temporarily on the
developer's machine (assuming the source is version controlled via other
means), as only a user wanting to install the package would need the archive
forms.

Here's the sequence I use:

Start with a source tree for the package somewhere.

Testing/checking:

Run R CMD INSTALL -l mytest mypkg (making sure you create the `mytest'
directory first).  This installs the package in the `mytest' directory.  If
the install is not successful, make necessary changes.  If successful, start
up R (from the command line) and do library(mypkg, lib.loc="mytest") and run
some tests (e.g., example() for functions in the package).

After making sure the installed package looks good, run R CMD check mypkg.
Make changes to correct errors and warnings.

After successful check, run R CMD build --force mypkg to generate the source
tarball and update the INDEX file.  (The --force is only needed if you
add/remove/change help page topics since the last build.)

Run R CMD build --binary mypkg if you need to distribute the package in
binary form.

HTH,
Andy