An attempt to use box for opionated project setup (inspired by dflow). Has some modules that are included in project setup - grab (module manager) and dir (box path setup).
To get started with a project, run boxingtape::setup()
. This will set up a template project with the following structure:
- /modules
- /dir
- /grab
- /R
- app.r
- .here
- .gitignore
With boxingtape, downloaded modules are intended to not be shared when uploading a project to github. Instead, users should run grab$install()
to download the modules listed in the package.json. This keeps the package.json as the source of truth, and keeps project sizes smaller.
Sets the box.path option to the here()
directory on load. E.g.
box::use(. / modules / dir / use_here_directory) # box.path is set as soon as this is loaded
Similar to use_here_directory
, but sets the box.path to a global module directory. By default, this is set to .libPaths[1]/module-library
. The directory can be set with options('module.dir' = a/path)
.
options('module.dir' = '~/R/module-library/') # Set the global directory
box::use(. / modules / dir / use_global_directory) # box.path is now set to module.dir
Rudementary module manager in the vein of yarn and npm. Load via box::use(. / modules / grab).
Initialise a template package.json file.
box::use(. / modules / grab)
grab$init()
Add a module to your package.json and install to module repo.
box::use(. / modules / grab)
grab$add(c('A/Repo','Another/Repo'))
Remove a module from your package.json file, and your local module directory if applicable.
box::use(. / modules / grab)
grab$remove(c('A/Repo','Another/Repo'))
grab$install() downloads all the modules listed in the package.json. Alternatively, grab$install('A/Repo') downloads a specified repository without adding to package.json.
box::use(. / modules / grab)
grab$install()
# or
grab$install('A/Repo')
Wrapper function that calls init() and then install(). Similar to running 'yarn' for any js users out there.
box::use(. / modules / grab)
grab$grab()
grab$upgrade() checks all modules listed in package.json for updates. Alternatively, grab$upgrade('A/Repo') updates a specified module.
box::use(. / modules / grab)
grab$upgrade()
# or
grab$upgrade('A/Repo')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.