π Week 02 Lab - Preparation
2023/24 Autumn Term
Before coming to the Week 02 lab, please complete the following preparation tasks:
- Follow the instructions on the Getting Ready page to set up your computer.
- If you are new to R, please book a place on the in-person R workshops offered by the LSE Digital Skills Lab.
- Follow the project setup instructions below.
- 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 DS202A project
Follow these instructions to set up a new DS202A 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.
Open RStudio.
Before creating a new project, install the package
renv
.
install.packages("renv")
Create a new project.
Click on
File > New Project > New Directory > New Project
. Choose an appropriate folder on your computer, and consider naming itDS202A
. 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
DS202A.RProj
file, which you can use as a shortcut to reopen your project at any time.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
Create a new folder in an appropriate folder on your computer. Consider naming it
DS202A
.Open VS Code and open the folder you have just created (
File > Open Folder
). Letβs call this your βprojectβ folder.Open an R Terminal inside VS Code and install the following packages:
install.packages("tidyverse")
install.packages("rmarkdown") # needed for .qmd files