An interactive dashboard for exploring passenger demand on the São Paulo metro, built with Shiny on top of the metrosp R data package. The interface is in Portuguese.
Try the live app — deployed on Posit Connect Cloud.
The app is standalone: it lives in its own repository and deploys separately from the data package.
- Line-level demand — monthly entrance/transported series per line, with KPIs and an optional STL trend overlay.
- Per-station series — monthly weekday transported averages and daily entries, kept as distinct measures.
- Interactive map — metric views for yearly demand with an animated year slider, year-over-year change, recovery vs. 2019, and the network by line. Station popups show KPIs and link to each station's series.
- Dataset downloads — the package datasets verbatim, in CSV / Excel / GPKG / GeoJSON.
STL uses the full available history within each uninterrupted monthly segment, then applies the selected display period. Missing months and values remain missing; segments with at most 24 observations have no trend estimate.
Start the app from the repository root.
shiny::runApp(".")renv manages the dependencies. The lockfile
(renv.lock) pins every package to an exact version and source, and it pins
metrosp 2.0.0 to GitHub commit 1bf8859,
which fixes archived station-name lookup when sf is loaded.
After cloning, restore the project library.
renv::restore()The repository root is the app, in Shiny's multi-file layout — global.R
(libraries, data prep, helpers, theme, sourced once at startup), ui.R,
server.R, www/, and a committed manifest.json. It
deploys as a unit.
Connect Cloud publishes straight from this public
GitHub repo. When it detects renv.lock, it calls renv::restore() to install
the packages, including the pinned GitHub revision of metrosp. manifest.json stays tracked
for app-type metadata, and no rsconnect push is required.
rsconnect::deployApp(appName = "metrosp-explorer")After adding or upgrading packages, re-snapshot and commit the lockfile.
renv::snapshot()The app reads the four rolling demand tables through
metrosp::read_metro_demand(). If any rolling table fails, it uses the four
bundled snapshots together and identifies that source in the interface. Line
and station geometries come from metrosp::rail_lines and
metrosp::rail_stations.
The metrosp package documents the datasets and original producers in its data dictionary. The STL trend overlay uses trendseries.
MIT © Vinicius Oike