| valid_na_index | R Documentation |
Check whether every position stored in the na_index attribute identifies a
genuine missing value in the vector. This can detect when external code has
changed a vector without refreshing its declared missing values metadata.
valid_na_index(x)
x |
An atomic vector, possibly containing an |
The check examines only the positions in na_index and stops at the first
invalid position. A missing or empty na_index attribute is valid.
A logical value. TRUE when every indexed value is a genuine NA;
otherwise FALSE.
x <- declared(c(1, -1, 3), na_values = -1)
valid_na_index(x)
attr(x, "na_index") <- 1
valid_na_index(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.