is_state {naijR}R 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"))


[Package naijR version 0.6.0 Index]