3.3 Importing SPSS Files (optional)

SPSS files can be loaded using the foreign package. For this example, you can download an SPSS file here.

# Install the package, run this only once
install.packages("foreign")

# Load the `foreign` library
library(foreign)

# Read the SPSS data
df_spss <- read.spss("problem2.sav",
                     to.data.frame = TRUE,
                     use.value.labels = FALSE)