Topic 1 · Day 2 · 4 hours
Department of Quantitative Methods in Economics and Management · ULPGC
Department of Quantitative Methods in Economics and Management · ULPGC
April 29, 2026
Yesterday a few of you committed straight to main. Easy to fix, but let’s get the muscle memory right today.
The two clicks, every day, before opening the exercise template:
day-2 → tick Sync branch with remote → Create.Look at the branch selector at the top of the Git pane. If it does not say day-2, stop and fix it before you type anything in the template.
Tip
Mantra: Sync · Pull · Branch · then edit.
|> and the tidyverse grammar.dplyr verbs: filter, select, mutate, arrange, summarise, group_by.tidyr: pivot_longer, pivot_wider, separate, unite.left_join, inner_join, anti_join.Read as: take hotels, keep long stays, compute revenue, sort descending.
dplyr verbs| Verb | Purpose |
|---|---|
filter() |
keep rows that match a condition |
select() |
keep / drop columns |
mutate() |
add or transform columns |
arrange() |
sort rows |
summarise() |
collapse to one row per group |
group_by() |
set the grouping context |
pivot_longer()Know your joins:
left_join() — keep every row of the left table.inner_join() — keep only matches.anti_join() — rows from left without a match on the right.|> chains verbs, reads left-to-right.group_by() |> summarise() is the bread and butter of reporting.Join an ISTAC occupancy file with an ISTAC capacity file, compute monthly occupancy rate by island, and produce a summary table for 2024.
Quantitative Methods in Tourism · Master in Tourism and Sustainable Development · TIDES · ULPGC