This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License (http://creativecommons.org/licenses/by-sa/4.0/).
The version of R used to make this document is 4.3.2.
The version of the rmarkdown
package used to make this document is 2.25.
The book Writing R Extensions. The whole book is relevant. Every word is needed for some R package somewhere.
Some example packages on my GitHub account.
R packages foo
and fooRegister
both in repository foo
.
R package bar
in the repo of the same name, which is also accompanied by a gist about regression packages.
R package baz
in repository mat
.
R package qux
in the repo of the same name.
R package linkingTo
in the repo of the same name.
None of this actually works in Rmarkdown because it is done from the command line, not from within R.
Getting a package from a Git repository
git clone git@github.com:cjgeyer/foo.git
(you may want to use a different URL https://github.com/cjgeyer/foo.git
).
Checking the package, any of
cd foo/package
R CMD build foo
R CMD check foo_*.tar.gz
R CMD check foo_*.tar.gz --as-cran # should be done with R-devel
R CMD check foo_*.tar.gz --use-valgrind
R CMD check foo_*.tar.gz --use-gct
On my laptop R CMD check --as-cran
reports a “note”
Found no calls to: ‘R_registerRoutines’, ‘R_useDynamicSymbols’
It is good practice to register native routines and to disable symbol search.
See ‘Writing portable packages’ in the ‘Writing R Extensions’ manual.
This is why the package fooRegister
exists. It does call these routines as Writing R Extensions suggests.
Nevertheless, it seems (to the extent that the tests in the package actually test the package) that the package does work.
When you check a package you should also read the output of examples
less foo.Rcheck/foo-Ex.Rout
and the manual
evince foo.Rcheck/foo-manual.pdf