is_era {era} | R Documentation |
Validation functions for era
objects
Description
Tests whether an object is an era definition (an era
object).
is_era()
tests whether the object inherits from the S3 class era_yr
.
is_valid_era()
performs additional checks to determine whether the object
is well-formed (see details).
validate_era()
throws an informative error message for invalid yr
s.
Usage
is_era(x)
validate_era(x)
is_valid_era(x)
Arguments
x |
Object to test. |
Details
Valid era
objects:
Must have all parameters set and not NA
Must have a character
label
parameterMust have a numeric
epoch
parameterMust have a character
name
parameterMust have a character
unit
parameter that is one of the defined unitsMust have a positive, integer
scale
parameterMust have a direction parameter that is -1 (backwards) or 1 (forwards)
Value
is_era()
and is_valid_era()
return TRUE
or FALSE
.
validate_era()
returns x
invisibly, and is used for its side-effect of
throwing an informative error for invalid objects.
See Also
Other era helper functions:
era_parameters
,
era_year_parameters
,
era_year
,
era
,
is_era_year()
,
is_yr()
,
this_year()