get_crs: Get CRS code

Description Usage Arguments Value Examples

Description

Get CRS code from a string with the station name.

Usage

1
get_crs(station, ...)

Arguments

station

String with the station name, partial names are allowed.

...

Arguments passed on to base::grep

ignore.case

if FALSE, the pattern matching is case sensitive and if TRUE, case is ignored during matching.

perl

logical. Should Perl-compatible regexps be used?

value

if FALSE, a vector containing the (integer) indices of the matches determined by grep is returned, and if TRUE, a vector containing the matching elements themselves is returned.

fixed

logical. If TRUE, pattern is a string to be matched as is. Overrides all conflicting arguments.

useBytes

logical. If TRUE the matching is done byte-by-byte rather than character-by-character. See ‘Details’.

invert

logical. If TRUE return indices or values for elements that do not match.

Value

Vector of strings with the matched CRS codes, or NULL if no match is found.

Examples

1
2
3
trainR::get_crs("London")
trainR::get_crs("Manchester")
trainR::get_crs("manchester", ignore.case = TRUE)

villegar/trainR documentation built on Aug. 14, 2021, 10:23 p.m.