is_state: Test an Object for States

View source: R/isreg.R

is_stateR Documentation

Test an Object for States

Description

Test an Object for States

Usage

is_state(x)

Arguments

x

A vector to be tested.

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.

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.

Note

The function throws a warning, when a missing value is among the elements. It works only for atomic vectors, throwing an error when this is not the case or when NULL is passed to it.

Examples

all(is_state(naijR::states()))
is_state(c("Maryland", "Baden-Baden", "Plateau", "Sussex"))


naijR documentation built on Aug. 8, 2023, 5:13 p.m.