6 R Project

Overview

  • Easier to access files (relative path)
    • Relative paths help prevent broken paths
      • In general, DO NOT use setwd()
      • Will work if the project folder is moved to a new location on you local machine or moved to a new machine.
  • Designed to easily integrate with version control (GIT)
  • In general, all data, scripts, and output should be stored within the project directory.

6.1 Create a New R Project

  1. Create a new R project by clicking on the dropdown menu at the top right of RStudio and selecting “New Project”

  1. Select “New Directory” within the “Create Project” window

  1. Select “New Project” within the “Project Type” window

  1. Enter a project name(below I have given the name “new_project”), the project directory (where the project should live), and select “Create Project”
    • Tip: Create a “project” folder that will act as your parent directory for all R projects. This will make it much easier to navigate to and between projects.

  1. A new session specific to your R project will start within RStudio
    • There are a number of ways to tell which project is open…