Quick/automated R package development workflow (assuming you’re using macOS or Linux) Part2
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
Disclaimer: I have no affiliation with the VS Code team, just a user who likes the product.
Earlier this week in #155, I posted about a quick/automated workflow for R package development at the command line. Using this workflow along with VS Code Editor – after experimenting it myself – is a breeze… Interested in using VS Code for your R package development? Read this resource: https://code.visualstudio.com/docs/languages/r.
Here’s the updated Makefile (as of 2024-08-30): https://gist.github.com/thierrymoudiki/3bd7cfa099aef0c64eb5f91138d8cedb
All you need to do is store it at the root of your package folder. Type make
or make help
at the command line to see all the commands available. You can start with make initialize
, that will install devtools
, usethis
and rmarkdown
, if they’re not available yet. Here’s what you can do so far (as of 2024-08-30):
buildsite
: create a website for your packagecheck
: check packageclean
: remove all build, and artifactscoverage
: get test coveragecreate
: create a new package in current directorydocs
: generate docsgetwd
: get current directoryinstall
: install packageinitialize
: initialize: install packages devtools, usethis, pkgdown and rmarkdownhelp
: print menu with all optionsload
: load all (when developing the package)render
: run R markdown file in /vignettes, open rendered HTML file in the browsersetwd
: set working directory to current directorystart
: start or restart R sessiontest
: runs the the package testsusegit
: initialize Git repo and initial commit
You can even chain operations by doing:
make check&&make install
Feel free to fork or comment the GitHub Gist if you have a suggestion like Prof. Rob J Hyndman who found it useful (like me). The more feedback, the better the experience for everyone 😉
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.