Quick/automated R package development workflow (assuming you’re using macOS or Linux) Part2

[This article was first published on T. Moudiki's Webpage - R, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
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 package
  • check: check package
  • clean: remove all build, and artifacts
  • coverage: get test coverage
  • create: create a new package in current directory
  • docs: generate docs
  • getwd: get current directory
  • install: install package
  • initialize: initialize: install packages devtools, usethis, pkgdown and rmarkdown
  • help: print menu with all options
  • load: load all (when developing the package)
  • render: run R markdown file in /vignettes, open rendered HTML file in the browser
  • setwd: set working directory to current directory
  • start: start or restart R session
  • test: runs the the package tests
  • usegit: 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 😉

idontowntherightsofthispic

To leave a comment for the author, please follow the link and comment on their blog: T. Moudiki's Webpage - R.

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.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)