olc_validate: Check the Validity of Open Location Codes

Description Usage Arguments Value See Also Examples

Description

These functions allow a useR to check whether OLCs they've been provided are valid or not. valid_short identifies whether a vector of OLCs are valid "short" codes; valid_long identifies whether OLCs are valid "long" codes, and valid_full identifies whether OLCs are valid, full stop.

Usage

1
2
3
4
5

Arguments

codes

a character vector containing Open Location Codes.

Value

a vector of TRUE and FALSE values, where TRUE corresponds to a valid code and FALSE an invalid.

See Also

decode_olc and encode_olc for creating and resolving valid Open Location Codes.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
#Validate that a particular OLC is valid
validate_olc("WC2345+G6g")
#[1] TRUE

#It is! Is it a short?
validate_short("WC2345+G6g")
#[1] TRUE
#Yep!

#So it's not full?
validate_full("WC2345+G6g")
#[1] FALSE
#Nope!

Example output

[1] TRUE
[1] TRUE
[1] FALSE

olctools documentation built on May 2, 2019, 4:21 a.m.