knitr::opts_chunk$set(echo = FALSE)
{width=50%}
- Research compendia
R packages
Code on github https://github.com/selinaZitrone/YoMos2020
- Slides on https://selinazitrone.github.io/YoMos2020/index.html
- Reproduciblity 🔃 (for you and others)
- Reliablity 🏋 (will it work again?)
- Re-usablity ⚙ (don't re-invent the wheel)
- Visiblity 🔍 (let others see and use your work)
{width=50%}
This is a collection of all digital parts of a research project including data, code, texts (protocols, reports, questionnaires, metadata). The collection is created in such a way that reproducing all results is straight forward.
(Definition from The Turing Way)
Excursion to Karthik Ram's talk at RStudio::conf 2019
{width=30%}
{width=100%}
R CMD check
)usethis
: workflow package to automate tasks like project setup etc.pkgdown
: build a quick and easy website for your packagegoodpractice
: gives you advice about good
practices when building R packagestestthat
: add unit testing to your package{width=40%}
- unit tests: functions that run a small amount of code: "units"
- input: defined and fixed
- compares output with an expected output
- returns true/false
- fewer bugs
- better code (needs to be testable)
- confidence and trust
- write tests either before or after implementing your code
- when you found a bug: before fixing, write a test that would have detected it
- use a test framework, e.g. in R:
testthat
package (Hadley Wickham)
"If it hurts, do it more often" (Martin Fowler)
- shared code repository (e.g. on github)
- push code frequently (every day)
- automated builds and tests after each commit
- immediate feedback if something doesn't work anymore
- however, can be time consuming and might be overkill for small or solo projects
- supports mac-OS, windows, linux, docker containers
- integration with github, so no separate setup and authentication
- free for open source, academic or educational repos
- 20 concurrent jobs (40 with pro), 6 h per job, 72 h per workflow
- self host to remove the per job limit
- very easy to setup with R using the
usethis
package
{width=20%}
R CMD check
Another excursion to Karthik Ram's talk at RStudio::conf 2019
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.