is.naCoarsened | R Documentation |
A coarsened factor, produced by the function coarsened
,
stores missing values differently from an ordinary factor. If the
base R function is.na
is applied to a coarsened factor, every element
of the result will be FALSE
. The function is.naCoarsened
is the suitable alternative to is.na
for coarsened factors.
is.naCoarsened(x)
x |
a coarsened factor |
A coarsened factor, produced by the function coarsened
,
has two types of levels. Base levels represent states of complete
information, and coarse levels represent states of incomplete or
missing information. Each coarse level maps onto two or more base
levels. The last coarse level is NA
, which
maps onto every base level.
A logical vector of the same length as x
, with TRUE
indicating that an element of x
is NA
, and FALSE
otherwise.
Joe Schafer Joseph.L.Schafer@census.gov
For more information about coarsened factors in the cvam
package, see the vignette Understanding Coarsened Factors in cvam.
cvam
,
coarsened
,
baseLevels
,
dropCoarseLevels
fac <- factor( c("red", "green", NA, "yellow", "notRed", "green") ) cFac <- coarsened( fac, levelsList = list("notRed" = c("green", "yellow")) ) is.naCoarsened(cFac)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.