background-image: url("images/bg_web.png") background-size: cover class: left, bottom <a href="https://github.com/edgar-treischl/Workshop_reproducibleR" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"/><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"/><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"/></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style> <h1 style="font-family: 'Bangers', sans-serif; font-size: 65px; color: #ffff;">Put R in</h1> <h1 style="font-family: 'Bangers', sans-serif; font-size: 65px; color: #ffff;">Production</h1> <br/> <p><a href="http://www.edgar-treischl.de" target="_blank" style="font-size: 35px; color: #ffff;">Edgar J. Treischl</a></p> <br/> .white[Last update: 2025-05-20] <br/> <h4 style = "color:#ffff; text-align: right;">Press β or β‘οΈ</h4> <div class="remark-footer"><a href="https://unsplash.com/de/@sajjadahmadi" target="_blank" style="color: gray;">Images: Sajjad Ahmadi</a></div> --- ## Agenda .pull-left[ ### 01 Develop π ### 02 Build π§ ### 03 Document π ### 04 Deploy πββοΈ ] .pull-right[ ] --- class: middle, center, inverse ## Let's face the truth ... --- background-image: url("https://i.giphy.com/media/v1.Y2lkPTc5MGI3NjExZTNpOWh5ZmJsdnk1Mnh0OGYxNHhvajZwNzFzbHZoNWw4aXAyY2c4YiZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/Qumf2QovTD4QxHPjy5/giphy.gif") background-size: cover class: bottom, center ## .white[... develop, but get rid of bad habits first <br> π] <div class="remark-footer"><a href="https://giphy.com/gifs/moodman-batman-smack-smacked-Qumf2QovTD4QxHPjy5" target="_blank" style="color: white;">Images source: MOODMAN</a></div> --- ## 01: Start with a clean slate and restart R .pull-left[ - Do not save the workspace and do not load the workspace from an `.Rdata` file (Based on Bryan et al. 2021). ### The rm approach π« - `rm(list = ls())` deletes user-created objects from the global workspace. - **But**: The script may break due to hidden dependencies on things you ran in this R process before you executed: Attached packages are not detached, changed options are not restored, working directory is untouched! ] .pull-right[ <figure> <img src="https://rstats.wtf/img/rstudio-workspace.png" style="width: 100%"/> </figure> ] --- ## Don't Go Places Where You Don't Belong ... <img src="images/drake.png" style="width: 65%"/> --- ## 01: Fix paths with the here package #### Abandon absolute paths, they will break anyway β‘ ``` r # Don't: readr::read_csv("~/Documents/Berichte/orig/104_data.csv") ``` ``` ## Error: '~/Documents/Berichte/orig/104_data.csv' does not exist. ``` #### Ceate a project and use the `here` package: ``` r # Here returns the path to the project here::here() ``` ``` ## [1] "/Users/edgar/Documents/GitHub/Workshop_reproducibleR" ``` ``` r # Create a path to the file here::here("data", "descriptive_title.csv") ``` ``` ## [1] "/Users/edgar/Documents/GitHub/Workshop_reproducibleR/data/descriptive_title.csv" ``` --- background-image: url(https://github.com/rstudio/hex-stickers/blob/main/PNG/knitr.png?raw=true) background-position: 90% 5% background-size: 8% ## 01: R vs. Rmd ### ποΈ Code lives in R, Code and Text in Rmd files If you need to create a document from a source code, run: ``` r #spin converts an R script to an Rmd file knitr::spin("script.R") ``` - Roxygen comments will be treated as text (more about that later) - Add yaml header to the script to control the output If you need to extract the code from an Rmd file, run: ``` r #Extracts R code chunks from Rmd files knitr::purl() ``` - Adjust the level of extraction with the `documentation` parameter (e.g., code only) - Set `purl = FALSE` to avoid the extraction of code chunks (see Xie 2024) --- background-image: url("https://i.giphy.com/media/v1.Y2lkPTc5MGI3NjExa3JkNnRydTJqdjNyNXlmMWd4MXRmeWkybzZ6eWdvaDc4amViejZ1eCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/10YHLXWAUpGUZq/giphy.gif") background-size: cover class: bottom, center # .red[Keep your version under control] <div class="remark-footer"><a href="https://giphy.com/gifs/love-batman-heart-10YHLXWAUpGUZq" target="_blank" style="color: black;">Source: adeanormal</a></div> --- background-image: url(https://github.githubassets.com/assets/GitHub-Mark-ea2971cee799.png) background-position: 90% 5% background-size: 8% ## 01: Git(Hub) ### Track changes over time <figure> <a href="https://r-pkgs.org" target="_blank"><img src="https://edgar-treischl.github.io/Workshop_GitHubIntro/images/Fig_0901.png" alt="www.edgar-treischl.de" width="95%"/> </figure> --- background-image: url(https://styler.r-lib.org/reference/figures/logo.png) background-position: 90% 5% background-size: 8% ## 01: Develop With Style(r) .pull-left[ <div class="info-box"> <i>π¦οΈοΈ</i> "styler formats your code according to the tidyverse style guide (https://style.tidyverse.org) (or your custom style guide) so you can direct your attention to the content of your code" (MΓΌller and Walthert 2024). </div> #### β‘ Easily apply tidyverse style or adjust and and apply your own style guide ] .pull-right[ ``` r styler::style_text( "myFunction<-function( x,y){ if(sum( x , y )==10){ print( 'Sum is correct!' ) } }" ) ``` ``` ## myFunction <- function(x, y) { ## if (sum(x, y) == 10) { ## print("Sum is correct!") ## } ## } ``` ] #### There a goodies β€οΈ if you develop an R package: ``` r #Stlye your package code, but automate via GitHub Actions styler::style_pkg() ``` --- background-image: url(https://github.com/r-lib/lintr/blob/main/man/figures/logo.png?raw=true) background-position: 90% 5% background-size: 8% ## 01: Lintr .pull-left[ <div class="info-box"> <i>π¦οΈ</i>"lintr provides static code analysis for R. It checks for adherence to a given style, identifying syntax errors and possible semantic issues, then reports them to you so you can take action" (Hester et al. 2024). </div> ] .pull-right[ ``` r lintr::lint(text = 'myFunction <- function(x, y) { if (sum(x, y) == 10) { print("Sum is correct!") } }') ``` ``` ## <text>:1:1: style: [object_name_linter] Variable and function name style should match snake_case or symbols. ## myFunction <- function(x, y) { ## ^~~~~~~~~~ ``` ] There are even more goodies π¦Ή if you develop an R package: ``` r #lintr::lint_dir(path = "R") lintr::lint_package() ``` --- background-image: url(https://i.gifer.com/8rTu.gif) background-size: cover class: bottom, center ## .white[Let's build ... π¦Ή] <div class="remark-footer"><a href="https://gifer.com/de/8rTu" target="_blank" style="color: black;">Source: Mark Hamill</a></div> --- ## 02: R Packages ### I will not create something like ggplot2, so why should I create a package anyway? π .pull-left[ - *Reusability and Distribution*: Make sure everything needed to run is available. Plus: simplifies version control, dependency management, and installation. - *Organization and Maintainability*: A package encourages a clean and organized code, making it easier to maintain, update, and extend over time. - *Documentation*: A package allows to include automatic documentation (help files, website, vignettes) , making it much easier for others - and the future yourself - to understand how it works. ] .pull-right[ <figure> <a href="https://r-pkgs.org" target="_blank"><img src="https://r-pkgs.org/images/cover-2e-small.png" alt="www.edgar-treischl.de" width="65%"/> </figure> ] --- ## 02: devtools does the heavy lifting ποΈ <div class="info-box"> <i>π¦</i> "The aim of devtools is to make package development easier by providing R functions that simplify and expedite common tasks. R Packages is a book based around this workflow." (Wickham et al. 2022) </div> .pull-left[ <figure> <a href="https://devtools.r-lib.org" target="_blank"><img src="images/devtools.png" alt="www.edgar-treischl.de" width="65%" align="right"/> </figure> ] .pull-right[ <figure> <a href="https://devtools.r-lib.org" target="_blank"><img src="https://devtools.r-lib.org/logo.svg" alt="www.edgar-treischl.de" width="55%" align="center"/> </figure> ] --- ## 02: usethis <div class="info-box"> <i>π¦</i> "usethis is a workflow package: it automates repetitive tasks that arise during project setup and development, both for R packages and non-package projects." (Wickham et al. 2022) </div> .pull-left[ ``` r #Create a new package usethis::create_package("path/to/package") ``` ``` r #Add a package in the DESCRIPTION file usethis::use_package("ggplot2") ``` ``` r #Add a readme file usethis::use_readme_rmd() ``` ] .pull-right[ <figure> <a href="https://usethis.r-lib.org/" target="_blank"><img src="https://usethis.r-lib.org/logo.png" alt="www.edgar-treischl.de" width="55%" align="center"/> </figure> ] --- background-image: url(https://usethis.r-lib.org/logo.png) background-position: 90% 5% background-size: 8% ## 02: Github Actions .pull-left[ Continuous Integration/Continuous Deployment: 1. *Reliability via Automated Testing*: We can automatically run tests on every commit, ensuring that code changes don't break functionality. 2. *Consistent Environments*: CI/CD pipelines define reproducible environments, ensuring that the code runs the same way on every machine, regardless the local setup. 3. *Effortless Deployment*: With GitHub Actions, you can automate the deployment of R Markdown reports, Shiny apps, R packages, and so on. ] .pull-right[ ```yaml # Workflow from: https://github.com/r-lib/actions/tree/v2/examples on: push: branches: [main, master] pull_request: branches: [main, master] name: R-CMD-check jobs: R-CMD-check: runs-on: ubuntu-latest env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} R_KEEP_PKG_SOURCE: yes steps: - uses: actions/checkout@v3 ... ``` ] --- background-image: url(https://usethis.r-lib.org/logo.png) background-position: 90% 5% background-size: 8% ## 02: Github Actions and usethis Usethis has predefined workflows for: ``` r usethis::use_github_action() # Which action do you want to add? (0 to exit) # (See <https://github.com/r-lib/actions/tree/v2/examples> for other options) # # 1: check-standard: Run `R CMD check` on Linux, macOS, and Windows # 2: test-coverage: Compute test coverage and report to https://about.codecov.io # 3: pr-commands: Add /document and /style commands for pull requests ``` --- background-image: url("https://i.gifer.com/8Bx3.gif") background-size: cover class: bottom, center # .black[... but don't forget to test π»] <div class="remark-footer"><a href="https://gifer.com/de/8Bx3" target="_blank" style="color: black;">Source: Gifer</a></div> --- background-image: url(https://testthat.r-lib.org/logo.png) background-position: 90% 5% background-size: 8% ## 02: testthat <br/> <div class="info-box"> <i>π¦</i> "Testing your code can be painful and tedious, but it greatly increases the quality of your code. testthat tries to make testing as fun as possible, so that you get a visceral satisfaction from writing tests. Testing should be addictive, so you do it all the time. (Wickham 2011)" </div> <br/> .pull-left[ ``` r #Set up the test infrastructure # And build a test usethis::use_test("name") ``` ] .pull-right[ <img src="images/testRStudio.png" style="width: 90%"/> ] --- background-image: url(https://covr.r-lib.org/reference/figures/logo.png) background-position: 90% 5% background-size: 8% ## 02: covr .panelset[ .panel[.panel-name[Test Coverage] .pull-left[ <div class="info-box"> <i>π¦οΈ</i>"Track test coverage for your R package and view reports locally or (optionally) upload the results to codecov or coveralls. (Hester 2023)" </div> ``` r # Inspect the test coverage covr::report() ``` ] .pull-right[ <img src="images/covr1.png" style="width: 90%"/> ] ] .panel[.panel-name[Tracked Source] <img src="images/covr.png" style="width: 90%"/> ] ] --- background-image: url(https://i.gifer.com/15X0.gif) background-size: cover class: bottom, center ## .red[Documentation] <div class="remark-footer"><a href="https://www.sarah-johnson.com/personal-art" target="_blank" style="color: black;">Source: Sarah Johnson</a></div> --- background-image: url(https://roxygen2.r-lib.org/logo.png) background-position: 90% 5% background-size: 8% ## 03 Document: roxygen2 .pull-left[ ### Describe your functions and ... <div class="info-box"> <i>π¦οΈ</i> "... roxygen2 will process your source code and comments to automatically generate .Rd files in man/, NAMESPACE, and, if needed, the Collate field in DESCRIPTION.". (Wickham and CsΓ‘rdi 2024) </div> - Help files for your functions will be available - The pkgdown package will use the roxygen2 comments to create a website for your package ] .pull-right[ ``` r #' Function title #' #' @description What does this `add` function. #' #' @param x Function parameter. #' @param y Function parameter. #' #' @return A number. #' #' @examples #' add(1, 1) #' @export add <- function(x, y) { x + y } ``` ] --- ## 03 Document: pkgdown .pull-left[ <div class="info-box"> <i>π¦οΈ</i> "The goal of pkgdown is to make it easy to make an elegant and useful package website with a minimum of work. You can get a basic website up and running in just a couple of minutes. If youβre using GitHub, we recommend setting up pkgdown and GitHub actions to automatically build and publish your site". (Wickham et al. 2024) </div> ] .pull-right[ <figure> <a href="https://pkgdown.r-lib.org" target="_blank"><img src="https://pkgdown.r-lib.org/logo.png" alt="https://pkgdown.r-lib.org" width="50%" align="center"/> </figure> ] <br> --- background-image: url(https://pkgdown.r-lib.org/logo.png) background-position: 90% 5% background-size: 8% ## 03 Document: pkgdown <br> <div style="position:relative; padding-bottom:56.25%; height:0; overflow:hidden; max-width:97%;"> <iframe src="https://pkgdown.r-lib.org" width="500" height="315" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen style="position:absolute; top:0; left:0; width:100%; height:100%;"></iframe> </div> --- background-image: url(https://pkgdown.r-lib.org/logo.png) background-position: 90% 5% background-size: 8% ## 03 Document: pkgdown ### Create a pkgdown website via: .pull-left[ ``` r #usethis creates config file: => _pkgdown.yml config file usethis::use_pkgdown() #Build the website via: pkgdown::build_site() ``` ### π via GitHub Actions: ``` r #Add corresponding GHA to deploy each time you push to GitHub usethis::use_pkgdown_github_pages() ``` ] .pull-right[ ```yaml # _pkgdown.yml url: https://edgar-treischl.github.io/ProjectX/ template: bootstrap: 5 bootswatch: litera bslib: base_font: {google: "Solway"} heading_font: {google: "Solway"} navbar: ... ``` ] --- background-image: url("https://i.giphy.com/media/v1.Y2lkPTc5MGI3NjExdnVmNnQzM2NzYWJuNDR5M2xoZGxtbnU4eWg2OWdsaWptMjVhMDg4dCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/l1J9JOEZqVI4JFEk0/giphy.gif") background-size: contain class: bottom, center <br> ## .white[Deploy] <div class="remark-footer"><a href="https://giphy.com/gifs/batman-robin-laundry-l1J9JOEZqVI4JFEk0" target="_blank" style="color: black;">Source: Threadless</a></div> --- ## 04: renv <div class="info-box"> <i>π¦</i> "The renv package helps you create reproducible environments for your R projects. Use renv to make your R projects more isolated, portable and reproducible" (Ushey and Wickham 2024). </div> .pull-left[ - Isolated: Installing a new or updated package for one project wonβt break your other projects, and vice versa. - Portable: Easily transport your projects from one computer to another, even across different platforms. - Reproducible: renv records the exact package versions you depend on, and ensures those exact versions are the ones that get installed." (Ushey and Wickham) ] .pull-right[ <figure> <a href="https://rstudio.github.io/renv/index.html" target="_blank"><img src="https://rstudio.github.io/renv/logo.svg" alt="The renv package" width="65%"/> </figure> ] --- background-image: url(https://rstudio.github.io/renv/logo.svg) background-position: 90% 5% background-size: 8% ## 04: renv .pull-left[ - Use `renv::init()` to initiate a new project: - Gives you the power of isolation because it creates a project library - Creates a .Rprofile file to load the renv library as long as renv is active - The package creates a renv.lock with metadata about every project package so that it can be installed on a new machine - Use `renv::snapshot()` to create a snapshot of the project environment - Use `renv::restore()` to restore the project environment ] .pull-right[ <figure> <a href="https://rstudio.github.io/renv/index.html" target="_blank"><img src="https://rstudio.github.io/renv/articles/renv.png" alt="www.edgar-treischl.de" width="95%"/> </figure> ] --- ## 04: renv lockfile ```shell "R": { "Version": "4.4.1", "Repositories": [ { "Name": "CRAN", "URL": "https://cloud.r-project.org" } ] }, "Packages": { "markdown": { "Package": "markdown", "Version": "1.0", "Source": "Repository", "Repository": "CRAN", "Hash": "4584a57f565dd7987d59dda3a02cfb41"} } ``` --- ## 04: Docker .pull-left[ Create, deploy, and run applications in containers: - Container: A standard unit of software that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another. - Dockerfile: A text document that contains all the commands a user could call on the command line to assemble an image. - Rocker: A project that provides different Docker images for R. Those bundles include the OS, R, (RStudio), and packages. ] .pull-right[ <figure> <a href="https://www.docker.com" target="_blank"><img src="images/docker.png" width="95%"/> </figure> ] --- background-image: url(https://rocker-project.org/img/rocker.png) background-position: 90% 5% background-size: 8% ## 04: Docker and Rocker <div class="info-box"><i>π¦</i> The Rocker Project provides a collection of (Linux) containers suited for different needs. Find a base image to extend or images with popular software and optimized libraries pre-installed. (Rocker website) </div> ```shell # Use a base R image from rocker project (official R Docker image) FROM rocker/r-ver:4.4.1 # Set a working directory in the container WORKDIR /app # Copy a simple R script into the container COPY hello.R . # Install necessary R packages (e.g., ggplot2) RUN R -e "install.packages(c('ggplot2'), repos='https://cloud.r-project.org/')" # Set the entry point to run the R script ENTRYPOINT ["Rscript", "hello.R"] ``` --- ## 04: sessioninfo ``` r mysession <- sessioninfo::session_info() mysession$platform ``` ``` ## setting value ## version R version 4.4.2 (2024-10-31) ## os macOS Sequoia 15.4.1 ## system aarch64, darwin20 ## ui X11 ## language (EN) ## collate en_US.UTF-8 ## ctype en_US.UTF-8 ## tz Europe/Berlin ## date 2025-05-20 ## pandoc 3.4 @ /Applications/RStudio.app/Contents/Resources/app/quarto/bin/tools/aarch64/ (via rmarkdown) ## quarto 1.6.39 @ /usr/local/bin/quarto ``` Set the parameter: `to_file = "session.log"` to export a log file --- ## 04: sessioninfo ``` r sessioninfo::session_info(info = "external") ``` ```bash β Session info βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β External software ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ setting value cairo 1.17.6 cairoFT pango 1.50.14 png 1.6.40 jpeg 9.5 tiff LIBTIFF, Version 4.5.0 tcl 8.6.13 curl 8.7.1 ... ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ ``` --- class: right, middle ## Thank you for your attention! <img style="border-radius: 50%;" src="https://avatars.githubusercontent.com/u/77931249?s=400&u=eaf1d0871b643dd32cc0ff9f777edef28e6569a8&v=4" width="150px"/> [<svg viewBox="0 0 512 512" style="height:1em;position:relative;display:inline-block;top:.1em;" xmlns="http://www.w3.org/2000/svg"> <path d="M505.12019,19.09375c-1.18945-5.53125-6.65819-11-12.207-12.1875C460.716,0,435.507,0,410.40747,0,307.17523,0,245.26909,55.20312,199.05238,128H94.83772c-16.34763.01562-35.55658,11.875-42.88664,26.48438L2.51562,253.29688A28.4,28.4,0,0,0,0,264a24.00867,24.00867,0,0,0,24.00582,24H127.81618l-22.47457,22.46875c-11.36521,11.36133-12.99607,32.25781,0,45.25L156.24582,406.625c11.15623,11.1875,32.15619,13.15625,45.27726,0l22.47457-22.46875V488a24.00867,24.00867,0,0,0,24.00581,24,28.55934,28.55934,0,0,0,10.707-2.51562l98.72834-49.39063c14.62888-7.29687,26.50776-26.5,26.50776-42.85937V312.79688c72.59753-46.3125,128.03493-108.40626,128.03493-211.09376C512.07526,76.5,512.07526,51.29688,505.12019,19.09375ZM384.04033,168A40,40,0,1,1,424.05,128,40.02322,40.02322,0,0,1,384.04033,168Z"></path></svg> www.edgar-treischl.de](https://www.edgar-treischl.de) [<svg viewBox="0 0 496 512" style="height:1em;position:relative;display:inline-block;top:.1em;" xmlns="http://www.w3.org/2000/svg"> <path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"></path></svg> edgar-treischl](https://github.com/edgar-treischl) [<svg viewBox="0 0 512 512" style="height:1em;position:relative;display:inline-block;top:.1em;" xmlns="http://www.w3.org/2000/svg"> <path d="M464 64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V112c0-26.51-21.49-48-48-48zm0 48v40.805c-22.422 18.259-58.168 46.651-134.587 106.49-16.841 13.247-50.201 45.072-73.413 44.701-23.208.375-56.579-31.459-73.413-44.701C106.18 199.465 70.425 171.067 48 152.805V112h416zM48 400V214.398c22.914 18.251 55.409 43.862 104.938 82.646 21.857 17.205 60.134 55.186 103.062 54.955 42.717.231 80.509-37.199 103.053-54.947 49.528-38.783 82.032-64.401 104.947-82.653V400H48z"></path></svg> edgar.treischl@isb.bayern.de](mailto:edgar.treischl@isb.bayern.de) --- class: right, middle ## Licence This presentation is licensed under a CC-BY-NC 4.0 license. You may copy, distribute, and use the slides in your own work, as long as you give attribution to the original author on each slide that you use. Commercial use of the contents of these slides is not allowed. <br/> <br/> <img src="images/by-nceu.png" alt="Image left" width="150px"/> --- ## References (1/2) <p><cite>Hester, J. (2023). <em>covr: Test Coverage for Packages</em>. URL: <a href="https://CRAN.R-project.org/package=covr">https://CRAN.R-project.org/package=covr</a>.</cite></p> <p><cite>Hester, J., F. Angly, R. Hyde, et al. (2024). <em>lintr: A 'Linter' for R Code</em>. URL: <a href="https://CRAN.R-project.org/package=lintr">https://CRAN.R-project.org/package=lintr</a>.</cite></p> <p><cite>MΓΌller, K. (2020). <em>here: A Simpler Way to Find Your Files</em>. R package version 1.0.1. URL: <a href="https://CRAN.R-project.org/package=here">https://CRAN.R-project.org/package=here</a>.</cite></p> <p><cite>MΓΌller, K. and L. Walthert (2024). <em>styler: Non-Invasive Pretty Printing of R Code</em>. URL: <a href="https://CRAN.R-project.org/package=styler">https://CRAN.R-project.org/package=styler</a>.</cite></p> <p><cite>Ushey, K. and H. Wickham (2024). <em>renv: Project Environments</em>. URL: <a href="https://CRAN.R-project.org/package=renv">https://CRAN.R-project.org/package=renv</a>.</cite></p> <p><cite>Wickham, H. (2023). <em>R Packages: Organize, Test, Document, and Share Your Code</em>. Sebastopol, CA: O'Reilly. URL: <a href="https://r-pkgs.org">https://r-pkgs.org</a>.</cite></p> <p><cite>Wickham, H. (2011). “testthat: Get Started with Testing”. In: <em>The R Journal</em> 3, pp. 5–10. URL: <a href="https://journal.r-project.org/archive/2011-1/RJournal_2011-1_Wickham.pdf">https://journal.r-project.org/archive/2011-1/RJournal_2011-1_Wickham.pdf</a>.</cite></p> <p><cite>Wickham, H., J. Bryan, and M. Barrett (2024). <em>usethis: Automate Package and Project Setup</em>. URL: <a href="https://CRAN.R-project.org/package=usethis">https://CRAN.R-project.org/package=usethis</a>.</cite></p> --- ## References (2/2) <p><cite>Wickham, H., W. Chang, R. Flight, et al. (2021). <em>sessioninfo: R Session Information</em>. R package version 1.2.2. URL: <a href="https://CRAN.R-project.org/package=sessioninfo">https://CRAN.R-project.org/package=sessioninfo</a>.</cite></p> <p><cite>Wickham, H., P. Danenberg, G. CsΓ‘rdi, et al. (2024). <em>roxygen2: In-Line Documentation for R</em>. URL: <a href="https://CRAN.R-project.org/package=roxygen2">https://CRAN.R-project.org/package=roxygen2</a>.</cite></p> <p><cite>Wickham, H., J. Hesselberth, M. Salmon, et al. (2024). <em>pkgdown: Make Static HTML Documentation for a Package</em>. URL: <a href="https://CRAN.R-project.org/package=pkgdown">https://CRAN.R-project.org/package=pkgdown</a>.</cite></p> <p><cite>Wickham, H., J. Hester, W. Chang, et al. (2022). <em>devtools: Tools to Make Developing R Packages Easier</em>. R package version 2.4.5. URL: <a href="https://CRAN.R-project.org/package=devtools">https://CRAN.R-project.org/package=devtools</a>.</cite></p> <p><cite>Xie, Y. (2024). <em>knitr: A General-Purpose Package for Dynamic Report Generation in R</em>. URL: <a href="https://CRAN.R-project.org/package=knitr">https://CRAN.R-project.org/package=knitr</a>.</cite></p>