class: center, middle, inverse, title-slide # Packages in a nutshell ## A Forwards Package Development module ###
Emma Rand ###
đź”—
bit.ly/pkg-dev-1
--- layout: true <div class="my-footer"> <span> <a href="http://bit.ly/pkg-dev-1" target="_blank">🔗 bit.ly/pkg-dev-1</a> </span> </div> <!-- Presenting on zoom or similar? Press C to clone your slides, then P for presenter mode for one set. You can share the whole screen version of the slides while still seeing you presenter view --> --- ## Welcome! .pull-left[ .center[ <img src="images/emma-rand.png" width="45%" style="display: block; margin: auto;" /> Emma Rand .small[ Senior Lecturer (Prof) Department of Biology, University of York, UK ] ] ] .pull-right[ .center[ <img src="images/mine.jpg" width="45%" style="display: block; margin: auto;" /> Dr. Mine Çetinkaya-Rundel .small[ Senior lecturer (Prof) Department of Statistical Science at Duke University, USA Educator and Data Scientist at RStudio ] ] ] .center[ [Forwards](https://forwards.github.io/) Teaching Team Leads ] ??? Hello and welcome to Packages in a Nutshell! We are Emma Rand and Mine Çetinkaya-Rundel and we are part of R Forwards which is an R Foundation task force to address underrepresentation in the R community and particularly the developer community. Forwards have delivered face-to-face one-day workshops in Package development, supported by a grant from the R Consortium, for several years. These are heavily based on the R packages book by Hadley Wickham and Jenny Bryan. Recently we have been modularising our workshop materials with the aim of increasing our ability to reach the many people who can't travel to a one-day workshop and make it easier for others to teach with our materials. --- ## Summary This workshop explains what a package is and why you might want to write one. - where packages come from - where they live on your computer - package states - package components ??? This workshop explains what a package is and why you might want to write one. It covers where packages come from, where they live on your computer and the different states a package can be in. We will explore the key components of a package using an example and outline the Forwards approach to package development process. --- ## Module Prerequisites Before starting this module you should have: - [installed R and RStudio](../prerequisite-guides/install-r-rstudio.md) - had some experience of coding in R - and it will help to have previously installed and loaded packages I suggest opening RStudio if you want to code along ??? The coding will be fairly short commands - you will not need a lot of space and can split your screen with zoom and RStudio. --- ## Be excellent to each other! 💛 Please use the chat! 💜 Be kind 💚 Be respectful ??? Our intention is make time for asking questions. Please use the chat. We hope you will feel comfortable posting your questions 'To everyone' because that will help create a supportive learning space for all of us but if you feel more comfortable messaging me or Mine, that's fine. --- ## Learning Objectives At the end of this module the successful learner will be able to: - explain the rationale for writing packages - find and explore their own package library/libraries - describe the key components of a package - describe the different states a package can be in - outline the development of a package using devtools ??? Add speaker notes --- class: middle, inverse # Why write a package? --- ## Why reusable components - You want to **generalise** it - You want to **document** it - You want to **test** it - You want to **share** it - You want to create **impact** from your work ??? Making a package helps you to make your work more reusable. If you find yourself copying and pasting chunks of code and changing a few variable names it means you are doing some thing that could be generalised. You may have written functions to save yourself some copying and pasting. Making a package takes that a step further. You do not need to make a package for others to use - it can be just for your use. The conventions and infrastructure around a package encourage you to document and test your functions. These aspects allow you to work reproducibly, collaborate with others and disseminate your work more easily. This helps you gain recognition and create impact from your work. --- ## The bad news .... it may be frustrating <img src="images/allie_brosh_argh.png" title="cartoon of a distressed being wrapped in a blanket" alt="cartoon of a distressed being wrapped in a blanket" width="500px" style="display: block; margin: auto;" /> .tiny[ COPYRIGHT: Allie Brosh http://hyperboleandahalf.blogspot.com/2010/09/four-levels-of-social-entrapment.html ] ??? It may be frustrating because working in a new way and learning new things is frustrating. --- ## The good news! .... frustration is normal and temporary. <img src="images/allie_brosh_happy.png" title="cartoon of a happy being sat at a desk and typing on laptop at 03:17" alt="cartoon of a happy being sat at a desk and typing on laptop at 03:17" width="500px" style="display: block; margin: auto;" /> .tiny[ COPYRIGHT: Allie Brosh http://hyperboleandahalf.blogspot.com/2010/06/this-is-why-ill-never-be-adult.html ] ??? Add speaker notes --- class: middle, inverse # Where do packages live? ??? Let us start by thinking about where packages live on your computer --- ## R packages live in a library <img src="images/library.png" title="photo of a library with a central atrium from ground to top floor flanked by six floors of shelved books" alt="photo of a library with a central atrium from ground to top floor flanked by six floors of shelved books" width="500px" style="display: block; margin: auto;" /> -- Where's the library? ??? This is the sort of statement experts make! What *is* a library? A directory into which packages are installed. We can start to answer this by learning more about our R installation. --- ## Get to know your R installation. .your-turn[ What version of R are you using? ] .scroll-output-height[ ```r R.version ``` ``` ## _ ## platform x86_64-w64-mingw32 ## arch x86_64 ## os mingw32 ## system x86_64, mingw32 ## status ## major 4 ## minor 1.1 ## year 2021 ## month 08 ## day 10 ## svn rev 80725 ## language R ## version.string R version 4.1.1 (2021-08-10) ## nickname Kick Things ``` ] ??? These green boxes are to indicate it is your turn to do something. It's your turn. Type R.version to see what version of R you are using. Post your version in chat. --- ## Get to know your R installation. .your-turn[ Where is R's home directory? ] ```r R.home() ``` ``` ## [1] "C:/PROGRA~1/R/R-41~1.1" ``` The R home directory is the top-level directory of the R installation being run. Note: this is **not** the same as your working directory or your home directory. ??? Now type R.home(). The name of the home directory will be the version you are using. The home directory is where R will look for the programs and functions it needs. You working directory is where R will look for your files. --- ## Get to know your R installation. .your-turn[ What is in R's home directory? ] ```r list.files(R.home()) ``` ``` ## [1] "bin" "CHANGES" "COPYING" ## [4] "doc" "etc" "include" ## [7] "library" "MD5" "modules" ## [10] "README" "README.R-4.1.1" "share" ## [13] "src" "Tcl" "tests" ## [16] "unins000.dat" "unins000.exe" ``` ??? Now do list.files(R.home()) The home directory contains these files and folders. Notice one of these is library. That library is your default library --- ## Get to know your R library .your-turn[ What is the default R library? ] ```r .Library ``` ``` ## [1] "C:/PROGRA~1/R/R-41~1.1/library" ``` The default library is in the home directory ??? It contains a folder for each package --- ## Get to know your R library .scroll-output-height[ ```r dir(.Library) ``` ``` ## [1] "askpass" "assertthat" "backports" ## [4] "base" "base64enc" "bibtex" ## [7] "bit" "bit64" "blob" ## [10] "bookdown" "boot" "brew" ## [13] "brio" "broom" "bslib" ## [16] "cachem" "callr" "cellranger" ## [19] "circlize" "class" "cli" ## [22] "clipr" "cluster" "codetools" ## [25] "colorspace" "commonmark" "compiler" ## [28] "countdown" "covr" "cpp11" ## [31] "crayon" "credentials" "crosstalk" ## [34] "curl" "data.table" "datasets" ## [37] "DBI" "dbplyr" "dendextend" ## [40] "desc" "devtools" "diffobj" ## [43] "digest" "downlit" "dplyr" ## [46] "DT" "dtplyr" "ellipsis" ## [49] "emmeans" "emo" "estimability" ## [52] "evaluate" "fansi" "farver" ## [55] "fastmap" "forcats" "foreign" ## [58] "fs" "gargle" "generics" ## [61] "gert" "GGally" "gganimate" ## [64] "ggplot2" "ggsignif" "gh" ## [67] "gitcreds" "GlobalOptions" "glue" ## [70] "googledrive" "googlesheets4" "graphics" ## [73] "grDevices" "grid" "gridExtra" ## [76] "gtable" "haven" "highr" ## [79] "hms" "htmltools" "htmlwidgets" ## [82] "httpuv" "httr" "ids" ## [85] "ini" "isoband" "jquerylib" ## [88] "jsonlite" "jtools" "kableExtra" ## [91] "KernSmooth" "knitr" "koRpus" ## [94] "koRpus.lang.en" "labeling" "later" ## [97] "lattice" "lazyeval" "lifecycle" ## [100] "likert" "lsmeans" "lubridate" ## [103] "magrittr" "markdown" "MASS" ## [106] "Matrix" "memoise" "methods" ## [109] "mgcv" "mime" "miniUI" ## [112] "minqa" "mitools" "mnormt" ## [115] "modelr" "multcompView" "munsell" ## [118] "mvtnorm" "nlme" "nnet" ## [121] "numDeriv" "openssl" "pander" ## [124] "parallel" "patchwork" "pillar" ## [127] "pkgbuild" "pkgconfig" "pkgload" ## [130] "plotly" "plyr" "praise" ## [133] "prettyunits" "processx" "progress" ## [136] "promises" "ps" "psych" ## [139] "purrr" "R6" "rappdirs" ## [142] "rcmdcheck" "RColorBrewer" "Rcpp" ## [145] "readr" "readxl" "RefManageR" ## [148] "rematch" "rematch2" "remotes" ## [151] "reprex" "reshape" "reshape2" ## [154] "rex" "rlang" "rmarkdown" ## [157] "RNHANES" "roxygen2" "rpart" ## [160] "rprojroot" "rstudioapi" "rversions" ## [163] "rvest" "sass" "scales" ## [166] "selectr" "servr" "sessioninfo" ## [169] "shape" "shiny" "shinydashboard" ## [172] "showtext" "showtextdb" "sourcetools" ## [175] "spatial" "splines" "stats" ## [178] "stats4" "stringi" "stringr" ## [181] "survey" "survival" "svglite" ## [184] "sylly" "sylly.en" "sys" ## [187] "sysfonts" "systemfonts" "tcltk" ## [190] "testthat" "tibble" "tidyHeatmap" ## [193] "tidyr" "tidyselect" "tidyverse" ## [196] "tinytex" "tmvnsim" "tools" ## [199] "translations" "tweenr" "tzdb" ## [202] "usethis" "utf8" "utils" ## [205] "uuid" "vctrs" "viridis" ## [208] "viridisLite" "vroom" "waldo" ## [211] "webshot" "whisker" "withr" ## [214] "wordcountaddin" "xaringan" "xaringanExtra" ## [217] "xaringanthemer" "xfun" "xml2" ## [220] "xopen" "xtable" "yaml" ## [223] "zip" ``` ] --- ## Get to know your R library .your-turn[ What libraries does R know about? ] ```r .libPaths() ``` ``` ## [1] "C:/Program Files/R/R-4.1.1/library" ## [2] "C:/Users/er13/R/win-library/4.1" ``` ??? How many libraries do you have access to? Post in chat --- ## Get to know your R library. For many R users `.Library` and `.libPaths()` are the same. -- Other R users maintain, or have access to, multiple libraries. -- .tip[ You may not have write access to the default library. ] ??? If you are working on a work machine or networked machine you may not have write access to the default library. That is, if someone else had to install R and Rstudio on the machine you are using, the chances are you won't have access. --- ## Where do R packages come from? <img src="images/stork.png" title="cartoon of a stork with baby suspended in blanket from its beak" alt="cartoon of a stork with baby suspended in blanket from its beak" width="400px" style="display: block; margin: auto;" /> ??? Add speaker notes --- ## Where do R packages come from? CRAN: ```r install.packages("praise") ``` GitHub: ```r remotes::install_github("rladies/praise") ``` Bioconductor ```r BiocManager::install("celaref") ``` ??? CRAN and GitHub, mostly but also some specialised package repositories such as Bioconductor. You can often find the latest features for a package in development on GitHub. Some packages never make it to CRAN. Not necessarily 'bad' packages, the author just hasn't done the paperwork required. To install to a particular library: install.packages("praise", lib = library) withr::with_libpaths(library, install_github("gaborcsardi/praise")) --- ## Your installed packages .your-turn[ How many packages do you have installed? ] ```r dim(installed.packages()) ``` ``` ## [1] 223 16 ``` -- The output of `installed.packages()` is a matrix; each row is a package -- I have 223 packages installed ??? Post how many packages you have installed to chat. Don't delete packages you don't recognise - they may be important for other packages. --- ## Your installed packages .your-turn[ View the matrix of installed packages ] ```r View(installed.packages()) ``` ??? You can see which library a package is installed in --- ## Your installed packages The columns give some information about each package: ```r colnames(installed.packages()) ``` ``` ## [1] "Package" "LibPath" ## [3] "Version" "Priority" ## [5] "Depends" "Imports" ## [7] "LinkingTo" "Suggests" ## [9] "Enhances" "License" ## [11] "License_is_FOSS" "License_restricts_use" ## [13] "OS_type" "MD5sum" ## [15] "NeedsCompilation" "Built" ``` ??? These column are documentations says what a package needs to work. Depends is used to indicate dependency on a particular version of R, and on packages that are to be loaded (with library()) whenever your package is loaded. Imports is used for packages that are needed by a package but that don’t need to be loaded with library(). Any package listed in Imports will need to be installed with your package Suggests is for packages that aren’t really necessary, but that are used in examples, vignettes, or tests. Packages listed in Suggests do not need to be installed with your package. When writing a package, these are things that need to be included --- ## Startup files .pull-left[ `.Rprofile` Code that runs at startup - Load workflow packages - Set options - Use in moderation! ] .pull-right[ `.Renviron` Settings for R - Set library paths - Set environment variables ] ??? Help you manage your library paths (amongst other things). You will edit these in set up. --- class: middle, inverse # Developing a script vs developing a package ??? We now have more understanding of what packages are and where they come from and live on your computer. Now we will consider the differences between developing a script and developing a package --- ## Different .pull-left-narrow[ .hand[.blue[Script]] - one-off data analysis - defined by `.R` extension - `library()` calls - documentation in `#` comments - `source()` ] .pull-right-wide[ .hand[.blue[Package]] - defines reusable components - defined by presence of `DESCRIPTION` file - Required packages specified in `DESCRIPTION`, made available in `NAMESPACE` file - documentation in files and `Roxygen` comments - Install and restart ] ??? When you are writing a script you load packages with a library() call and document your code with comments using a #. The code is used for a one-off analysis and is stored in a .R file. The code is one off in the sense that it directly references your dataframes and variables When you write a package, your code is written to be reusable - functions are generalisable - their argument types are defined A package is defined by the presence of a DESCRIPTION file (at least in RStudio). It is in this file that you say what the package does, who wrote it and what dependencies it has. Required packages are made available not through a library call, but through the NAMESPACE file. As this hints at, the documentation is different - their is package and function level documentation. --- ## Same Iterate early and often! Change it, try it, change it, try it, ??? However, the logic of the process is similar. You write something, try it out, change it, try it out, change it. A lot. --- class: middle, inverse # Explore! --- ## Explore .your-turn[ Look at [Stephanie Kirmer's](https://github.com/skirmer) demo package [here](https://github.com/forwards/workshops/tree/master/Chicago2019/demoPackage) - Where’s the R code? What is it mostly comprised of? - What do you think is in the DESCRIPTION file? - How about the NAMESPACE file? ] ??? Mainly comments in the form: #' goToTheZoo DESCRIPTION has package metadata. The presence of this file is what makes and RStudio Project a package. NAMESPACE gives the functions imported and exported This looks like a lot of files to get right! Fortunately the devtools approach will make most of this automatically! --- class: middle, inverse # Package states --- ## Package states There are five states a package can be in: - source - bundled - binary - installed - in-memory ??? Having a understanding of the different states a package can be in is helpful in understanding package development. --- <img src="images/annotated_installation.png" title="schematic of package states and the functions that move them between states. One the horizontal axis: source, bundle, binary, installed, in memory. One the vertical axis the functions install.packages, R CMD install, install, build, install_github" alt="schematic of package states and the functions that move them between states. One the horizontal axis: source, bundle, binary, installed, in memory. One the vertical axis the functions install.packages, R CMD install, install, build, install_github" width="870px" style="display: block; margin: auto;" /> .tiny[ Figure from [R Packages](https://r-pkgs.org/) <a name=cite-Wickham_Bryan></a>([Wickham and Bryan, 2020](#bib-Wickham_Bryan)) https://github.com/hadley/r-pkgs/blob/master/diagrams/installation.png ] ??? when you develop a package, you write Source code. When you use a package, it is in the memory. Functions move packages between states. You already know some of the functions that move packages between states. For example, `install.packages()` and `remotes::install_github()` move a package from source, bundled, or binary states into the installed state. The `library()` function loads an installed package into memory, making it available for immediate and direct use. --- ## Package states .pull-left-narrow[ - .tip[source] - bundled - binary - installed - in-memory ] .pull-right-wide[ .tip[ What you create and work on. Specific directory structure with some particular components e.g., `DESCRIPTION`, an `R/` directory. We examined the source of the demoPackage ] ] ??? Now we examine these states in a little more detail. --- ## Package states .your-turn[ Visit the CRAN landing page for `readxl`: https://cran.r-project.org/package=readxl And the GitHub repository where `readxl` is developed in the open: https://github.com/tidyverse/readxl ] ??? Encourage people to do this if there is time. --- ## Package states .pull-left-narrow[ - source - .tip[bundled] - binary - installed - in-memory ] .pull-right-wide[ .tip[ Also known as "source tarballs". Package files compressed to single file. Conventionally `.tar.gz` You don't normally need to make one. Unpacked it looks very like the source package ] ] ??? In the rare case that you need to make a bundle from a package you’re developing locally, use devtools::build(). Under the hood, this calls pkgbuild::build() and, ultimately, R CMD build, which is described further in the Building package tarballs section of Writing R Extensions. --- ## Package states .pull-left-narrow[ - source - bundled - .tip[binary] - installed - in-memory ] .pull-right-wide[ .tip[ Package distribution for users w/o dev tools Also a single file Platform specific: `.tgz` (Mac) `.zip` (Windows) Package developers submit a bundle to CRAN; CRAN makes and distributes binaries `install.packages()` ] ] ??? A package in binary form is Platform specific. If you write a package for distribution on CRAN, you submit a bundle to CRAN then CRAN makes and distributes binaries `install.packages()` is usually downloading the binary To understand the difference between package bundle and a package binary see https://r-pkgs.org/package-structure-state.html --- ## Package states .pull-left-narrow[ - source - bundled - binary - .tip[installed] - in-memory ] .pull-right-wide[ .tip[ A binary package that’s been decompressed into a package library Command line tool `R CMD INSTALL` powers all package installation ] ] ??? Add speaker notes --- <img src="images/installation.png" title="schematic of package states and the functions that move them between states. One the horizontal axis: source, bundle, binary, installed, in memory. One the vertical axis the functions install.packages, R CMD install, install, build, install_github" alt="schematic of package states and the functions that move them between states. One the horizontal axis: source, bundle, binary, installed, in memory. One the vertical axis the functions install.packages, R CMD install, install, build, install_github" width="900px" style="display: block; margin: auto;" /> There's more than one route (tool) for installation. .tiny[ Figure from [R Packages](https://r-pkgs.org/) ([Wickham and Bryan, 2020](#bib-Wickham_Bryan)) https://github.com/hadley/r-pkgs/blob/master/diagrams/installation.png ] ??? --- ## Package states .pull-left-narrow[ - source - bundled - binary - installed - .tip[in-memory] ] .pull-right-wide[ .tip[ If a package is installed, `library()` makes its function available by loading the package into memory and attaching it to the search path. We do not use `library()` for packages we are working on `devtools::load_all()` loads a source package directly into memory. ] ] ??? Add speaker notes --- class: middle, inverse # Workflow ??? What is the workflow we use in writing packages? --- ## Workflow <img src="images/annotated_load_all.png" title="schematic of package states: source, bundle, binary, installed, in memory. It shows the load_all() function making a direct line from source to in-memory" alt="schematic of package states: source, bundle, binary, installed, in memory. It shows the load_all() function making a direct line from source to in-memory" width="800px" style="display: block; margin: auto;" /> `devtools::load_all()` is to package development as interactive “stepping through” code is to script development ??? devtools::load_all() simulates package installation, i.e., it puts the package in to memory. --- # Workflow <img src="images/annotated_install_and_restart.png" title="schematic of package states: source, bundle, binary, installed, in memory. It shows Install and Restart making a direct line from source to installed and then installed to in-memory" alt="schematic of package states: source, bundle, binary, installed, in memory. It shows Install and Restart making a direct line from source to installed and then installed to in-memory" width="800px" style="display: block; margin: auto;" /> RStudio’s Install & Restart is to package development as `source()` is to script development ??? Add speaker notes --- ## Workflow Use `devtools::load_all( )` a lot! (And “Install and Restart” sparingly) ??? Add speaker notes --- class: middle, inverse # Approach --- ## Approach We follow the approach used in [R Packages](https://r-pkgs.org/) ([Wickham and Bryan, 2020](#bib-Wickham_Bryan)): - uses `devtools` - in RStudio but commands rather than menus - version controlled using git - hosted on GitHub ??? This approach makes package development a little easier by automating some of the steps, i.e., there are packages to make package development easier! --- class: middle, inverse # Summary --- ## Summary - packages allow you to generalise, test, document and share your code - packages come from CRAN and GitHub (mainly) but some other specialised repositories - they live in libraries (folders) on your pc - you write source, submit bundles, install binaries (mainly), and use in-memory - we use `devtools::load_all()` during development a lot ??? Add speaker notes --- class: middle, inverse # Where next? --- ## Where next? R Forwards modules - [Setting up your system](https://www.eventbrite.co.uk/e/r-forwards-package-development-module-setting-up-your-system-tickets-132115790887) - [Your first package!](https://www.eventbrite.co.uk/e/r-forwards-package-development-module-your-first-package-tickets-132115738731) Other sources - [Writing R Extensions](https://cran.r-project.org/doc/manuals/R-exts.html) 1999–2020 R Core Team - [R Packages](https://r-pkgs.org/) ([Wickham and Bryan, 2020](#bib-Wickham_Bryan)) - Hillary Parker's [Writing an R package from scratch](https://hilaryparker.com/2014/04/29/writing-an-r-package-from-scratch/) - Karl Broman's [R package primer a minimal tutorial](https://kbroman.org/pkg_primer/) ??? Setting up your system sign up close 1800 GMT Monday Your first package! sign up close 1800 GMT Tuesday note - Writing R Extensions is not a tutorial, it's a reference. I was directed here years ago and decided I couldn't write a package. Then, a few years later, I read Hilary Parker's post. --- class: middle, inverse # What questions do you have? --- class: middle, inverse # Acknowledgements --- Slides made with: **`knitr`** <a name=cite-knitr1></a><a name=cite-knitr2></a><a name=cite-knitr3></a>([Xie, 2020](#bib-knitr1); [Xie, 2015](#bib-knitr2); [Xie, 2014](#bib-knitr3)),**`R Markdown`** <a name=cite-markdown1></a><a name=cite-markdown2></a>([Allaire Xie, et al., 2019](#bib-markdown1); [Xie Allaire, et al., 2018](#bib-markdown2)), **`xaringan`** <a name=cite-xaringan></a>([Xie, 2019](#bib-xaringan)), **`xaringanthemer`** <a name=cite-xaringanthemer></a>([Aden-Buie, 2020a](#bib-xaringanthemer)), **`xaringanExtra`** <a name=cite-xaringanExtra></a>([Aden-Buie, 2020c](#bib-xaringanExtra)), **`countdown`** <a name=cite-countdown></a>([Aden-Buie, 2020b](#bib-countdown)). Referencing with **`RefManageR`** <a name=cite-McLean-2017></a>([McLean, 2017](#bib-McLean-2017)). Designed by: [Mine Çetinkaya-Rundel](https://twitter.com/minebocek) and [Emma Rand](https://twitter.com/er13_r) --- ## References .tiny[ <a name=bib-countdown></a>[Aden-Buie, G.](#cite-countdown) (2020b). _countdown: A Countdown Timer for R Markdown HTML Presentations and Documents_. R package version 0.3.5. URL: [https://github.com/gadenbuie/countdown](https://github.com/gadenbuie/countdown). <a name=bib-xaringanExtra></a>[Aden-Buie, G.](#cite-xaringanExtra) (2020c). _xaringanExtra: Extras And Extensions for Xaringan Slides_. R package version 0.2.3.9000. URL: [https://github.com/gadenbuie/xaringanExtra](https://github.com/gadenbuie/xaringanExtra). <a name=bib-xaringanthemer></a>[Aden-Buie, G.](#cite-xaringanthemer) (2020a). _xaringanthemer: Custom 'xaringan' CSS Themes_. R package version 0.3.0. URL: [https://CRAN.R-project.org/package=xaringanthemer](https://CRAN.R-project.org/package=xaringanthemer). <a name=bib-markdown1></a>[Allaire, J., Y. Xie, et al.](#cite-markdown1) (2019). _rmarkdown: Dynamic Documents for R_. R package version 1.16. URL: [https://github.com/rstudio/rmarkdown](https://github.com/rstudio/rmarkdown). <a name=bib-McLean-2017></a>[McLean, M. W.](#cite-McLean-2017) (2017). "RefManageR: Import and Manage BibTeX and BibLaTeX References in R". In: _The Journal of Open Source Software_. DOI: [10.21105/joss.00338](https://doi.org/10.21105%2Fjoss.00338). <a name=bib-Wickham_Bryan></a>[Wickham, H. and J. Bryan](#cite-Wickham_Bryan) (2020). _R Packages_. the work-in-progress 2nd edition. Online. URL: [https://r-pkgs.org/index.html](https://r-pkgs.org/index.html). <a name=bib-knitr3></a>[Xie, Y.](#cite-knitr3) (2014). "knitr: A Comprehensive Tool for Reproducible Research in R". In: _Implementing Reproducible Computational Research_. Ed. by V. Stodden, F. Leisch and R. D. Peng. ISBN 978-1466561595. Chapman and Hall/CRC. URL: [http://www.crcpress.com/product/isbn/9781466561595](http://www.crcpress.com/product/isbn/9781466561595). <a name=bib-knitr2></a>[Xie, Y.](#cite-knitr2) (2015). _Dynamic Documents with R and knitr_. 2nd. ISBN 978-1498716963. Boca Raton, Florida: Chapman and Hall/CRC. URL: [https://yihui.org/knitr/](https://yihui.org/knitr/). <a name=bib-xaringan></a>[Xie, Y.](#cite-xaringan) (2019). _xaringan: Presentation Ninja_. R package version 0.12. URL: [https://CRAN.R-project.org/package=xaringan](https://CRAN.R-project.org/package=xaringan). <a name=bib-knitr1></a>[Xie, Y.](#cite-knitr1) (2020). _knitr: A General-Purpose Package for Dynamic Report Generation in R_. R package version 1.30. URL: [https://yihui.org/knitr/](https://yihui.org/knitr/). <a name=bib-markdown2></a>[Xie, Y., J. Allaire, et al.](#cite-markdown2) (2018). _R Markdown: The Definitive Guide_. ISBN 9781138359338. Boca Raton, Florida: Chapman and Hall/CRC. URL: [https://bookdown.org/yihui/rmarkdown](https://bookdown.org/yihui/rmarkdown). ] --- ## License <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png" /></a><br /><span xmlns:dct="http://purl.org/dc/terms/" property="dct:title">Package Development Module: Packages in a nutshell</span> by <span xmlns:cc="http://creativecommons.org/ns#" property="cc:attributionName">Forwards</span> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/">Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License</a>.