find_closest_year: Find the closest year to a given date

View source: R/utils.R

find_closest_yearR Documentation

Find the closest year to a given date

Description

This function takes a date as input and returns the closest year.

Usage

find_closest_year(date)

Arguments

date

A date in the format of "YYYY-MM-DD".

Value

An integer representing the closest year to the input date.

Examples

## Not run: 
find_closest_year(as.Date("2022-07-15"))
find_closest_year(as.Date("2022-01-01"))

## End(Not run)


fHMM documentation built on Oct. 12, 2023, 5:10 p.m.