Data manager/statistician for CHAI project at ISGlobal.
PhD in statistics.
R user, developper, addict.
R-Ladies BCN co-organizer.
Co-editor at rOpenSci onboarding (more on that later!)
Coding style (against errors, and for future readers&contributors)
Tests (such good safeguards!)
Structure (follow the rules)
Documentation (think of the users, including you in 3 months!)
Not mentioned today: features, performance
Automatic suggestions of improvements
Not automatic corrections⦠Animo!
For each tool,
Introduction
Application to fakepackage
. https://github.com/maelle/fakepackage
Questions any time chic@s!
Necessary before any CRAN submission, useful anyway
Package structure (bye bye, left-over files), missing documentation, dependencies.
Runs tests, checks examples and vignettes.
ERROR/WARNING/NOTE
https://juliasilge.com/blog/beginners-guide-to-travis/
lintr
, Static Code Analysis for Rlintr
?lintr
!lintr
unit testif (requireNamespace("lintr", quietly = TRUE)) {
context("lints")
test_that("Package Style", {
lintr::expect_lint_free()
})
}
with_defaults(camel_case_linter = NULL, # you prefer camel case
snake_case_linter, # so flag snake case
line_length_linter(120)) # you love long lines
goodpractice
, Advice on R Package Building by Gabor Csardigoodpractice
presentationactually uses some lintr
linters.
tunable but I like the defaults.
āAdvice includes functions and syntax to avoid, package structure, code complexity, code formatting, etc.ā
goodpractice
and fakepackage
devtools::spell_check()
devtools::spell_check()
Function written by Jeroen Ooms.
Letās try it!
Also good to know, devtools::release()
when submitting a package to CRAN.
pkgdown
, Generate static html documentation for an R packagepkgdown
A package by Hadley Wickham.
Minimal effort from existing documentation to website!
pkgdown
for fakepackage
pkgdown::build_website()
after correcting my name.
Change settings of the Github repo.
Add URL in repo and advertise it!
pkgdown
on fakepackage
: customizationCreate a file at the root of the repo called _pkgdown.yml
Styles, see https://bootswatch.com/
Group functions & vignettes. Use pkgdown::template_blabla
as starting point.
Example https://github.com/dirkschumacher/ompr/blob/master/_pkgdown.yml
R CMD check
lintr
devtools::spell_check()
goodpractice::gp()
pkgdown::build_site()
Continuous integration, cf this post of Julia Silgeās
Online code coverage services such as codecov.io
Any other suggestion?
Hadley Wickhamās book āR Packagesā
Hadley Wickhamās strict
package
rOpenSciās CRAN Task View about package development https://github.com/ropensci/PackageDevelopment
Package name check via available
. https://github.com/ropenscilabs/available
available::available("dplyr")
available::available("chicken")
Peer-review at work or among friends
rOpenSci onboarding system! Who wants to become a reviewer?
Github: maelle
Twitter: ma_salmon
And you can also talk to me now!
Thanks for coming and listening!