## ----setup--------------------------------------------------------------------
library(gtfsrealtime)
library(ggplot2)

## -----------------------------------------------------------------------------
positions = read_gtfsrt_positions(
  system.file("nyc-vehicle-positions.pb.bz2", package = "gtfsrealtime"),
  "America/New_York",
  as_sf = TRUE
)

## -----------------------------------------------------------------------------
head(positions)

## ----fig.width=8, fig.height=6------------------------------------------------
positions |>
  ggplot(aes(color=occupancy_status)) +
    geom_sf() +
    theme_minimal()

