πŸ“š Week 01 Lab - Preparation

2023/24 Winter Term

Author

Before coming to the Week 01 lab, please complete the following preparation tasks:

  1. Follow the instructions on the Getting Ready page to set up your computer.
  2. If you are new to R, please book a place on the in-person R workshops offered by the LSE Digital Skills Lab.
  3. Follow the project setup instructions below.
  4. Got any problems with the above? Post a message on the #help-installation channel on Slack. If instructors are not available, other colleagues may be able to help you.

Set up a new DS202W project

Follow these instructions to set up a new DS202W project folder, which you will use not just in this week’s lab but all labs.

You can set up your project for RStudio or VS Code, depending on your preferences. If you are new to all this, we recommend using RStudio since it is what most R programmers use.

  1. Open RStudio.

  2. Before creating a new project, install the package renv.

install.packages("renv")
  1. Create a new project.

    Click on File > New Project > New Directory > New Project. Choose an appropriate folder on your computer, and consider naming it DS202W. If you tick the Use renv with this project option (recommended), this will create an isolated virtual environment for your project in which you will install any new libraries that we use in this course.

    In this newly created project folder, you will find (among others) a DS202W.RProj file, which you can use as a shortcut to reopen your project at any time.

  2. Install packages.

    Open your project (if not already open) and install the following packages. If you have selected the Use renv option earlier, this should now install the libraries inside your project environment, otherwise in your global R environment.

install.packages("tidyverse")
install.packages("rmarkdown") # needed for .qmd files
  1. Create a new folder in an appropriate folder on your computer. Consider naming it DS202W.

  2. Open VS Code and open the folder you have just created (File > Open Folder). Let’s call this your β€˜project’ folder.

  3. Open an R Terminal inside VS Code and install the following packages:

install.packages("tidyverse")
install.packages("rmarkdown") # needed for .qmd files