1 Installation
1.1 R and Rstudio
If you already have an R and/or Rstudio installation, make sure they are updated. The RStudio installation should have at least v2023. You can check this via Help > About RStudio.
- Open Software Center
- Install R for Windows Suite
Installing R packages on a Utrecht University laptop can be hard. This is because R packages are installed on a so-called ‘mounted’ drive. This causes problems with the performance. Check the installation as follows:
- Open RStudio
- Write the following line of code in your console:
.libPaths()
, and press enter to execute. - If the response starts with
//
or\\
, you are installing on a mounted drive. This can cause various errors, and even if everything goes right, installing tidyverse takes ages.- Solution 1: see the solution on the intranet.
- Solution 2:
- Create a folder
R-packages
on a local drive. - Copy the location to that drive. For example:
C:/Users/User/R-packages
. - Run the following line of code:
file.edit(file.path("~", ".Rprofile"))
- Paste
.libPaths("C:/Users/User/R-packages")
in the editor and save the file. - Restart your R session
- Click on
Packages
>Install
. IsInstall to library
pointing toC:/Users/User/R-packages
? - If not: check if the path is correctly spelled. Try inverting the slashes (
\
instead of/
). You may need to use double slashes (\\
or//
). - Tick ‘source on save’, click save, and check
Packages
>Install
again.
I.e. a laptop with administrator rights.
- Download and install R from https://cran.rstudio.com/
- Download and install Rstudio from https://posit.co/download/rstudio-desktop/#download
1.2 Quarto
- Download Quarto from the Quarto website. The website will automatically select the correct installation file based on your operating system.
- Double click on the installation file to install it on your PC.
- Check that Quarto is installed:
- Restart RStudio.
- In RStudio, go to the Terminal (next to the Console), type
quarto --version
and press Enter. A version number should appear. - Alternatively, go to File > New project > New directory and check whether the Quarto outputs are presented as options (Quarto project, Quarto website, Quarto blog, Quarto book)
1.3 GitHub account
If you do not have a GitHub account, make one! Follow the steps here.
Preferably do not use your work e-mail address. Why? Because then you won’t be able to use your GitHub account anymore in case you leave your current job!
1.4 git
Installing git correctly may take a bit more time. This is because we need to:
- Install git at a good location, and
- Link the local git installation to your GitHub account
Especially the latter part is sometimes difficult, but it will pay off! If the installation went correctly, you will be able to “download” information from, or “upload” information to, GitHub to your local PC without having to open a web browser!
Please follow all the steps laid out on this page.