[Rd] How to correctly write a package?

Vladimir Eremeev wl2776 at gmail.com
Mon May 28 17:34:27 CEST 2007


I am writing a package.

Please, study the sequence of my actions below, and comment, what's
incorrect.
The package contains pure R code.

1. At the one level up from the package directory, from the system command
prompt:
R CMD build --binary ac9

This produces the file ac9_0.1.zip (The package name is ac9, and the
package's DESCRIPTION file says its version is 0.1)

2. Then I run Rgui in the other directory and "Install package(s) from local
zip files"

3. Issue the following commands in the command of Rgui from step 2 :

library(ac9)
 [calls to functions from the package] 

4. If I see errors, I quit Rgui from step 2, then change (hopefully)
properly the source package code, and
go to step 1.

What would happen if I don't quit Rgui from the step 2?
Would it reload the new function definitions?

Is there any other methods to refine a packaged code, which experienced
package writers use in their routine work?

I have created package source using package.skeleton, and have documented
the functions. 
Updating of the function body and re-use of the package.skeleton with
force=TRUE overwrites the documentation files. This disallows often use of
this function, or requires keeping the backup copy of the package sources.
-- 
View this message in context: http://www.nabble.com/How-to-correctly-write-a-package--tf3828586.html#a10837938
Sent from the R devel mailing list archive at Nabble.com.



More information about the R-devel mailing list