library(easypackages)
# Geospatial core
easypackages::packages(
"sf", # Simple Features: vector data
"terra", # Raster data (modern replacement for raster)
"tmap", # Thematic maps
"tmaptools", # Helper tools for tmap
"ggspatial", # Spatial layers for ggplot2 (scale bar, north arrow)
"tidyterra", # tidyverse integration for terra
"osmdata", # Download OpenStreetMap data
"OpenStreetMap", # Render OSM tiles as background maps
"tidygeocoder", # Geocoding via public APIs
"exactextractr" # Fast raster extraction for polygons
)
# Spatial statistics
easypackages::packages(
"spdep", # Spatial dependence (weights, autocorrelation tests)
"sfdep", # tidyverse-compatible interface to spdep
"spatialreg", # Spatial regression models
"spatstat" # Spatial point pattern analysis
)
# Data manipulation
easypackages::packages(
"dplyr", # Data wrangling
"tidyr", # Data tidying
"tibble", # Modern data frames
"readr", # Fast data import
"purrr", # Functional programming
"magrittr", # Pipe operators
"glue", # String interpolation
"stringr", # String manipulation
"units" # Physical units for numeric vectors
)
# Visualization
easypackages::packages(
"ggplot2", # Grammar of graphics
"cowplot", # Plot composition and alignment
"colorBlindness", # Color-blind-friendly palettes
"gganimate", # Animated ggplot2 maps and plots
"leaflet", # Interactive web maps
"mapview", # Quick interactive spatial data viewing
"patchwork" # Combine multiple ggplot2 plots
)
# --- Non-CRAN Packages --------------------------------------------------------
# These packages are hosted on GitHub or GESIS GitLab.
# Install 'pak' first if not already available.
if (!requireNamespace("pak", quietly = TRUE)) install.packages("pak")
pak::pkg_install(c(
"StefanJuenger/bkggeocoder", # Offline geocoding (BKG), developed at GESIS
"StefanJuenger/z11", # German Census 2011 grid data
"jslth/z22", # German Census 2022 grid data
"jslth/ffm", # BKG administrative boundaries archive
"git::https://git.gesis.org/sora-service/sora.git" # GESIS survey data access
))Exercise 1: Package Installation
Introduction to Geospatial Techniques for Social Scientists in R
Exercises
This is the first exercise in this workshop, and it is relatively easy and short. Its purpose is to get used to this exercise format and, more importantly, to install all necessary packages for this course.
And here comes our very first exercise (which is not very spatial…):
That’s it. Please notify us if there are any issues with installing the packages or, more generally, your R installation.
…oh, and while you are done and the others are still struggling with package installation: