Skip to content

SDA Preliminary setup

EMbeDS-education edited this page Oct 25, 2026 · 1 revision

Preliminary Setup

The course will include hands-on coding sessions in R.
Participants are therefore asked to complete the following setup before the first lecture.

1. Install Required Software

Please install the latest versions of:

2. Install Required Packages

Open RStudio and run:

install.packages(c(
  "sf",
  "terra",
  "tidyverse",
  "fixest",
  "spdep"
))

Note for Windows users:
You may see a warning mentioning Rtools during package installation.
In most cases this is harmless if the packages install successfully.

3. Run the Setup Test

After installing the packages, run the following script in RStudio:

library(sf)
library(terra)
library(tidyverse)
library(fixest)
library(spdep)

cat("\n--- sf external software versions ---\n")
print(sf_extSoftVersion())

cat("\n--- Loading vector data ---\n")

nc <- st_read(system.file("shape/nc.shp", package = "sf"),
              quiet = TRUE)

print(nc)

cat("\n--- CRS information ---\n")
print(st_crs(nc))

cat("\n--- Plotting vector data ---\n")
plot(st_geometry(nc))

cat("\n--- Creating raster ---\n")

r <- rast(nrows = 10, ncols = 10)

values(r) <- runif(ncell(r))

plot(r)

cat("\n--- Running regression test ---\n")

data(airquality)

est <- feols(Temp ~ Wind + Solar.R, data = airquality)

print(summary(est))

cat("\nSetup test completed successfully.\n")

4. Expected Outcome

If the setup is successful:

  • no errors should appear;
  • two plots should be displayed:
    • a map,
    • a raster;
  • the message
Setup test completed successfully.

should appear at the end of the console output.

If you encounter installation problems, please contact the instructor before the first lecture.

Clone this wiki locally