After module 4, you should be able to…
RStudio “Project” is one highly recommended strategy to build organized and reproducible code in R.
Let’s create a new RStudio Project.
Find the File Menu in the Menu Bar –> New Project –> New Directory –> New Project
Name your Project “IntroToR_RProject”
This is my personal preference for organizing an R Project. But, for this workshop it will be mandatory as it will help us help you. A critical component of conducting any data analysis is being able to reproduce it! Organizing your code, data, output, and figures is a necessary (although not sufficient) condition for reproducibility.
Create 4 sub-directories with the following names within your “SISMID_IntroToR_RProject” folder:
We will be working from this directory for the remainder of the Workshop. Take a moment to move any R scripts you have already created to the ‘code’ sub-directory.
getwd()
you will find the working directory is set to the location where the R Project was saved.If you simply open RStudio, it will not automatically open your R Project. As a result, when you say run a function to import data using the relative path based on your working directory, it won’t be able to find the data.
To open a previously created R Project, you need to open the R Project (i.e., double click on SISMID_IntroToR_RProject.RProj)
These are the materials we looked through, modified, or extracted to complete this module’s lecture.