Tests whether an object is a vector of years with an era (a yr object).
is_yr() tests whether the object inherits from the S3 class era_yr.
is_valid_yr() performs additional checks to determine whether the object
is well-formed (see details).
validate_yr() throws an informative error message for invalid yrs.
Value
is_yr() and is_valid_yr() return TRUE or FALSE.
validate_yr() returns x invisibly, and is used for its side-effect of
throwing an informative error for invalid objects.
Details
Valid yr objects:
Must contain numeric data (NAs are allowed)
Must have the
eraattribute set and not NAMust not have more than one era
Must have an
eraattribute that is a valid era object (seevalidate_era())
See also
Other era helper functions:
era,
era_parameters,
era_year,
era_year_parameters,
is_era(),
is_era_year(),
this_year()