round_year: Round years to decades or centuries

Description Usage Arguments Value Examples

Description

This function takes a year as a numeric value and rounds it to the nearest decade or century.

Usage

1
round_year(year, round_to = c("decade", "century"))

Arguments

year

Year to test (as a number)

round_to

Round the year to either the decade or century.

Value

The rounded year as an integer.

Examples

1
2
3
set_of_years <- seq(1892, 1923, 4)
round_year(set_of_years) # round to decade by default
round_year(set_of_years, round_to = "century")

lmullen/mullenMisc documentation built on May 21, 2019, 7:35 a.m.