2 - Overview of R packages used
This section aim to introduce brively which R packages environment we will use. Since several years, the R communities evolve in many interesting ways and today if you want to write your own package there are a lot of support that you can find.
First of all, it’s difficult to talk about package whithout talk about the tidyverse approach. Tidyverse is a collection of R packages designed for data science. They share an underlying design philosophy, grammar, and data structures. If you use R, it’s allmost sure that you have allready use this kind of packages, maybe even without knowing them. Even if there are none mandatary for R use, theses packages bring a lot of benefices and at the end make data science easier, faster, and more fun (yes, you will see).
So far we don’t go deeper into all the useful R packages of the tidyverse collection, but only focusing on theses related to the R packages developement.
The first one is called devtools [1]. The aim of this package is to make R package development easier by providing R functions that simplify and expedite common tasks. In practical, if you use the Rstudio IDE you will not interact directly with this package because the majority of common processes will be integrated automatically in the Rstudio environment and become “click button” processes.
The second one is the sub-package you are most likely to interact with directly. It be called usethis [2] and is aim is to automates repetitive tasks that arise during project setup and development. The idea is to, if it’s possible, use functions available by the package, rather that modify directely the code, to reduce error and be sure to have the last version of process strucutre.
There are two more important packages related to design of the documentation: roxygen2 [3] and pkgdown [4]. With the first one throught the use of tags, the code and the documentation are adjacent and dynamically inspects the objects that it’s documenting. We will go back to them into the following sections but keep in your mind that theses two tools simplify and automate the documentation creation and evolution.
In addition we will use or talk about several other packages, for example lintr [6] or renv [7], but it’s more a case-by-case utilisation and we will discuss them when the time comes.