qm_validate: Validate input vector

View source: R/qm_validate.R

qm_validateR Documentation

Validate input vector

Description

This function ensures that the input vector values match valid values in a source shapefile.

Usage

qm_validate(ref, key, value)

Arguments

ref

An sf object that serves as a master list of features

key

Name of geographic id variable in the ref object to match input values to

value

A vector of input values created with qm_define

Value

A logical scalar that is TRUE is all input values match values in the key variable.

See Also

qm_define

Examples

# load and format reference data
stl <- stLouis
stl <- dplyr::mutate(stl, TRACTCE = as.numeric(TRACTCE))

# create clusters
clusterValid <- qm_define(118600, 119101, 119300)
clusterError <- qm_define(118600, 119101, 800000)

# validate clusters
qm_validate(ref = stl, key = TRACTCE, value = clusterValid)

qm_validate(ref = stl, key = TRACTCE, value = clusterError)


qualmap documentation built on May 31, 2022, 9:05 a.m.