Install dependencies for R:
# install.packages("devtools")
devtools::install_dev_deps()
Install dependencies for JavaScript:
npm install
Build the JS/CSS bundle (outputs to inst/htmlwidgets
):
npm run build
Then load (devtools::load_all()
) or reinstall the package.
These generated files should be added in their own separate commit, preferably only once per branch.
Run R tests:
devtools::test()
# With test coverage (requires DT)
# install.packages("DT")
covr::report()
Run JavaScript tests:
npm test
# With test coverage
npm run test:cover
# Update test snapshots
npm run test:update
Lint and format the JS/CSS:
npm run lint
npm run format
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.