MyNixOS website logo
Description

'São Paulo' Metro Passenger Demand Data.

Provides passenger demand data for the 'São Paulo' metro system, covering 2012 to 2025. Datasets include monthly passenger entries and transported counts by line, average weekday station entries, daily station entries, and spatial geometries for metro and commuter train lines and stations.

metrosp: metro ridership in São Paulo

This packages helps distribute demand data from the São Paulo metro system inside R. Data is sourced from multiple operators and spans 2012-2025. While most of the data is already public, it’s scattered across multiple poorly structured CSV/PDF files.

Information on lines 1, 2, 3, 5, and 15 are sourced from the open data portal from METRÔ, while lines 4 and 5 (post-2018) are sourced from Dataverse (Insper).

All datasets are returned as tibble objects and are “lazy” datasets, meaning they are bundled with the package and don’t need to be downloaded. The data is also cleaned and standardized to make it easier to work with.

Line Coverage

The package currently covers all metro lines in São Paulo. In the future it may be expanded to include trains as well.

LineNameOperatorPeriodStatus
1Azul (Blue)METRÔ2017–2025Available
2Verde (Green)METRÔ2017–2025Available
3Vermelha (Red)METRÔ2017–2025Available
4Amarela (Yellow)ViaQuatro2012–2025Available
5Lilás (Lilac)ViaMobilidade2017–2025Available
15Prata (Silver)METRÔ2017–2025Available

Installation

The package will be available on CRAN. Once released, install with:

install.packages("metrosp")

To install the development version from GitHub, use:

# install.packages("remotes")
remotes::install_github("viniciusoike/metrosp")

Datasets

The table below describes all datasets that are shipped with the package. The main datasets are: passengers_entrance, passengers_transported, station_averages, and station_daily. Other datasets are auxiliary tables aimed at facilitating analysis and visualization.

DatasetDescriptionFrequencySpatial
passengers_entranceAverage passenger entries by lineMonthlyNo
passengers_transportedAverage passengers transported by lineMonthlyNo
station_averagesAverage weekday passenger entries by stationMonthlyNo
station_dailyDaily passenger entries by stationDailyNo
metro_linesMetro line reference table (names, colors, operators)No
metro_colorsNamed vector of official metro line colorsNo
linesMetro and train line routes (current + planned)Yes
stationsMetro and train station locations (current + planned)Yes

Usage

library(metrosp)
# To work with spatial datasets (lines, stations)
library(sf)
# For better tables load dplyr or tibble
library(dplyr)

# Passenger entries by line
passengers_entrance

# Station-level weekday averages
station_averages

# Spatial line routes
lines

Data sources

Metadata

Version

1.0.0

License

Unknown

Platforms (80)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arc-linux
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • sh4-linux
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows