Learn R Programming

gtfs2gps (version 1.4-1)

append_height: Add a column with height to GPS data

Description

Add a column named height to GPS data using a tif data as reference.

Usage

append_height(gps, heightfile)

Arguments

gps

A GPS data created from gtfs2gps().

heightfile

The pathname of a tif file with height data.

Value

The GPS data with a new column named height.

Examples

Run this code
# NOT RUN {
library(dplyr)

fortaleza <- system.file("extdata/fortaleza.zip", package = "gtfs2gps")
srtmfile <- system.file("extdata/fortaleza-srtm.tif", package = "gtfs2gps")

gtfs <- read_gtfs(fortaleza) %>%
  filter_week_days() %>%
  filter_single_trip() %>%
  remove_invalid()

fortaleza_gps <- gtfs2gps(gtfs) %>% append_height(srtmfile)
# }

Run the code above in your browser using DataLab