valid_na_index: Validate the declared missing values index
Description
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.
Usage
valid_na_index(x)
Value
A logical value. TRUE when every indexed value is a genuine NA;
otherwise FALSE.
Arguments
x
An atomic vector, possibly containing an na_index attribute.
Details
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.