Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

Code Block
> hello()
Hello World!
> goodbye("SayonaraCruel World")
Goodbye: Cruel SayonaraWorld!

Creating the Package Skeleton

...

  1. "name": This is the name of the package, "helloWorld" in this example. package.skeleton() will create a subdirectory in the current working directory with this name. This new directory will contain all the files a file for each function in the package, as well as ???.
  2. "list": This is a character vector naming the R objects that should be put into the package, "hello" and "goodbye" in this example.
Code Block
> package.skeleton(name="helloWorld", list=c("hello", "goodbye"))
Creating directories ...
Creating DESCRIPTION ...
Creating Read-and-delete-me ...
Saving functions and data ...
Making help files ...
Done.
Further steps are described in './helloWorld/Read-and-delete-me'.

The "Read-and-delete-me" file contains information on the additional steps for creating the Packageis the high level guide for completing the documentation.  The files ending in *.Rd under helloWorld/man/ are 'self documenting', guiding the author through the documentation process.  The source code is placed in helloWorld/R/.  Fill in the package attributes in the helloWorld/DESCRIPTION file.

Note: There are other ways to create an R package using package.skeleton; see the function help file for details.

Additional Resources

Details on writing R packages can be found here: http://cran.r-project.org/doc/manuals/R-exts.pdf