Usage
usage.Rmd
Setup
You can use the use_many()
function from the root of a package.
It will create the srcpkg
directory and copy existing files from the R/
directory to it.
# usethis::create_package("my.pkg")
# setwd("my.pkg")
many::use_many()
Note that the
R
directory gets wiped at everybundle
call. Do not edit any of the files within it.
From there call many::bundle()
to copy your files across.
Bundling
You do not want to run bundle()
manually after every change to the source code.
Below are some options, pick your favourite.
Custom Document
Use the custom many::document()
function which simply runs many::bundle()
followed by devtools::document()
.
Custom Load all
Use the custom many::load_all()
function which simply runs many::bundle()
followed by devtools::load_all()
.
Roclet
Potential issue where
rd
seems to always run beforemany::roclet_many()
.
Use the roxygen2 roclet many::roclet_many()
in your DESCRIPTION
as indicated below in order to bundle the files every time you run devtools::document()
.
RStudio Addin
Look for the “Bundle” addin in RStudio and select it. The addin will bundle any file in srcpkg
on save.
Vscode
The easiest is probably to add a command to the emeraldwalk plugin.