Learn R Programming

naijR (version 0.3.2)

is_state: Test an Object for States

Description

Test an Object for States

Usage

is_state(x)

Arguments

x

A vector to be tested.

Value

A logical vector.of same length as the input. If the input object is not even of type character, return the object unaltered, with a warning.

Details

An element-wise check of a supplied vector is carried out. To test an entire vector and return a single boolean value, functions such as base::all or base::any should be used.

Examples

Run this code
# NOT RUN {
all(is_state(naijR::states()))
is_state(c("Maryland", "Baden-Baden", "Plateau", "Sussex"))

# }

Run the code above in your browser using DataLab