Summary and Schedule
This is a new lesson built with The Carpentries Workbench.
Setup Instructions | Download files required for the lesson | |
Duration: 00h 00m | 1. Course introduction |
What is reproducible research? Why is it important? |
Duration: 00h 30m | 2. Good Practices | What good practices can to help us develop reproducible, reusable and computationally correct R code? |
Duration: 02h 00m | 3. Code readability |
Why does code readability matter? How can I organise my code to be more readable? What types of documentation can I include to improve the readability of my code? |
Duration: 03h 30m | 4. Code structure |
How can we best structure our R project? What are conventional places to store data, code, results and tests within our research project? ::: |
Duration: 05h 00m | 5. Code documentation |
How should we document our R code? Why is documentation important? What are the minimum elements of documentation needed to support reproducible research? |
Duration: 06h 30m | 6. Code correctness |
How can we verify that our code is correct? How can we automate testing in R? What makes a “good” test? Which parts of our code should we prioritise for testing? |
Duration: 08h 00m | 7. Reproducible development environment | How can we manage R dependencies in our analysis projects? |
Duration: 08h 30m | 8. Wrap-up |
What reproducible research practices have we covered in this
course? What tools and practices should you learn next? |
Duration: 08h 45m | Finish |
The actual schedule may vary slightly depending on the topics and exercises chosen by the instructor.
Code Setup
We will be using an example project in the lesson. Download the file using the link below and extract it to your computer: - zip file of example project.
Software Setup
Discussion
This lesson assumes you have R and RStudio installed on your computer. Please follow the setup instructions below.
To install R and RStudio on a personal laptop
Packages
The course teaches the tidyverse, which is a collection of R packages that are designed to make many common data analysis tasks easier. Please install this before the course. You can do this by starting Rstudio, and typing:
R
install.packages("tidyverse")
At the > prompt in the left hand window of RStudio. You may be prompted to select a mirror to use; either select one in the UK, or the “cloud” option at the start of the list.
R will download the packages that constitute the tidyverse, and then install them. This can take some time. You may get a prompt There are binary versions available but the source versions are later and asking if you want to install from sources packages which require compilation. You should answer no to this.
If you are using a mac you may be prompted whether you wish to install binary or source versions of the packages; you should select binary.
On Linux, several of the packages will be compiled from source. This can take several minutes. You may find that you need to install additional development libraries to allow this to happen.
There will be a number of messages displayed during installation. After the installation has completed you should see a message containing:
OUTPUT
** testing if installed package can be loaded
* DONE (tidyverse)
Or:
OUTPUT
package ‘tidyverse’ successfully unpacked and MD5 sums checked
Check Your Installation
Type the following commands at the > prompt:
R
library(tidyverse)
ggplot(cars, aes(x=speed, y=dist)) + geom_point()
(any message about conflicts can be safely ignored) This should produce a plot in the lower right hand window of RStudio.