yr_era: Get or set the era of a vector of years

View source: R/s3-yr.R

yr_eraR Documentation

Get or set the era of a vector of years

Description

Functions for extracting or assigning the era of a vector of years. This function does not alter the underlying values of x. Use yr_transform() to convert the values of a yr vector to a new era.

Usage

yr_era(x)

yr_set_era(x, era)

yr_era(x) <- value

Arguments

x

A vector of years.

value, era

An era object (see era()) to be assigned to x.

Value

yr_era(x) returns the existing era associated with x.

yr_set_era(x, era) and yr_era(x) <- era return x with the new era assigned. If x is not already a yr vector, it will attempt to coerce it into one.

See Also

Other years with era functions: yr_transform(), yr()

Examples

x <- 5000:5050
yr_era(x) <- era("cal BP")
yr_era(x)

era documentation built on Nov. 17, 2022, 5:06 p.m.