is.missing: Find out which elements of a vector have missing values

View source: R/is.missing.R

is.missingR Documentation

Find out which elements of a vector have missing values

Description

Find out which elements of a vector have missing values

Usage

is.missing(x, codelist = attr(x, "codelist"))

Arguments

x

vector for which the missing elements have to be detected.

codelist

a codelist object or a data.frame that is a valid code list.

Details

Unlike is.na is.missing will also return TRUE for elements of x whose values are indicated in the code list to be missing values. For that to work codelist needs to be a valid codelist with a 'missing' column. This column needs to be interpretable as a logical vector. When codelist is missing or does not contain a 'missing' column the result of is.missing is the same as is.na.

Value

Returns a logical vector of the same length as x with TRUE indicating corresponing values in x that can be considered to be missing.


codelist documentation built on April 12, 2025, 2:25 a.m.