write_gtfs: Write GTFS data into a zip file

View source: R/write_gtfs.R

write_gtfsR Documentation

Write GTFS data into a zip file

Description

Write GTFS stored in memory as a list of data.tables into a zipped GTFS feed. This function overwrites the zip file if it exists.

Usage

write_gtfs(gtfs, zipfile, overwrite = TRUE, quiet = FALSE)

Arguments

gtfs

A GTFS data set stored in memory as a list of data.tables/data.frames.

zipfile

The pathname of a .zip file to be saved with the GTFS data.

overwrite

A logical. Whether to overwrite an existing .zip file. Defaults to TRUE.

quiet

A logical. Whether to hide log messages and progress bars. Defaults to TRUE.

Value

The status value returned by the external zip command, invisibly.

Examples

library(magrittr)

# read a gtfs.zip to memory
poa <- read_gtfs(system.file("extdata/poa.zip", package = "gtfs2gps")) %>%
  gtfstools::filter_by_shape_id("T2-1") %>%
  filter_single_trip()

# write GTFS data into a zip file
write_gtfs(poa, paste0(tempdir(), "/mypoa.zip"))


gtfs2gps documentation built on April 29, 2023, 1:12 a.m.