Using lintr and styler to improve the quality and readability of R code (CC300)

August 26, 2024 • PD Schloss • 1 min read

The tidyverse style guide is a popular set of rules that you can apply to R code to improve the readability and quality of your code. Thankfully, the lintr package is able to screen our code (it’s a “linter”) to see where we may have violated some of these rules and the styler package is able to correct many of these violations. I show how to use these tools to pass the linter. Then I show how to incorporate the linter into a GitHub action to lint our R code whenever we push code to GitHub. This episode is part of an ongoing effort to develop an R package that implements the naive Bayesian classifier for classifying 16S rRNA gene sequences.

Code

You can browse the state of the repositories at the