Topic 2 · Day 5 · 2 hours
Department of Quantitative Methods in Economics and Management · ULPGC
Department of Quantitative Methods in Economics and Management · ULPGC
April 29, 2026
x, y, colour, size, shape, alpha.Run this once at the start of the session — every example below uses hotels.
library(dplyr)
library(ggplot2)
library(tidyr)
hotels |>
select(where(is.numeric)) |>
cor(use = "pairwise.complete.obs") |>
as.data.frame() |>
tibble::rownames_to_column("var1") |>
pivot_longer(-var1, names_to = "var2", values_to = "r") |>
ggplot(aes(var1, var2, fill = r)) +
geom_tile() +
scale_fill_gradient2(midpoint = 0, limits = c(-1, 1)) +
theme_minimal()alpha, jitter, or 2D binning.Using the Eurostat monthly nights file already downloaded (datasets/raw/eurostat-nights_monthly.csv), pick 4-6 EU countries and produce a faceted line plot:
facet_wrap(~ geo)),colour = factor(year)),The plot should make seasonality and the COVID dip visible at a glance.
Quantitative Methods in Tourism · Master in Tourism and Sustainable Development · TIDES · ULPGC