Oxford IHTM Handbook
Open Science and Reproducible Research Handbook
1
Introduction
1.1
All about R
1.2
Open and reproducible science
2
Installing R, RStudio, and Git and registering a GitHub account
2.1
Register a GitHub account
2.2
Setup for Windows machines
2.2.1
Install R for Windows machines
2.2.2
Install RStudio
2.2.3
Install
Rtools
2.2.4
Install Git for Windows
2.3
Setup for macOS machines
2.3.1
Install R for macOS machines
2.3.2
Install RStudio
2.3.3
Install git for macOS
2.4
Setup Git and GitHub for all machines
2.4.1
Introduce yourself to Git
2.4.2
Connecting Git, GitHub, and RStudio
3
Introduction to R and RStudio
3.1
What is R?
3.2
Why use R?
3.3
What is RStudio
4
Introduction to git and GitHub
4.1
All about git
4.2
All about GitHub
4.2.1
Creating a GitHub account
5
Connecting RStudio with GitHub
6
Writing functions
7
Cloning a GitHub repository into your local computer using RStudio
7.1
Copy the repository URL of the repository you want to clone from GitHub
7.2
Go to RStudio and create new project
7.3
Choose Version Control
7.4
Select Git
7.5
Setup repository settings
8
Committing your changes and pushing them to GitHub
8.1
Click on
Commit
in the Git tab on RStudio
8.2
Getting changes saved and push to GitHub
8.3
Initiate a pull request
9
Participating in an existing R/RStudio project
9.1
Clone the project to your local machine
9.2
Create a new branch from the main branch
9.2.1
Click on
New Branch
9.2.2
Name the new branch
9.3
Code and make changes to your branch
9.4
Commit and push your changes and initiate a pull request
9.5
Merge pull request
10
Initiating an R/RStudio project
10.1
1. Create a new project in RStudio
10.1.1
1.1 Click on
New Project
button on RStudio
10.1.2
1.2 Create a
New Directory
10.1.3
1.3 Select
New Project
as project type
10.1.4
1.4 Specify details for new project
10.2
2. Structure/organise your new project appropriately
10.3
3. Start coding
10.4
Next steps
11
Creating portable and reproducible scientific workflows
11.1
Step 1: Create a new RStudio project
11.2
Step 2: Create an R file called
packages.R
11.3
Step 3: Create placeholder directories for different components of workflow
11.4
Step 4: Create the target script file (
_targets.R
)
11.5
Step 5: Edit the
_targets.R
script file
@ University of Oxford International Health and Tropical Medicine 2023
University of Oxford International Health and Tropical Medicine
University of Oxford International Health and Tropical Medicine
Proochista Ariana and Ernest Guevarra
2023-09-27
Open Science and Reproducible Research Handbook