consecutive_month: Find the current month number relative to a starting date

View source: R/datetime_tools.R

consecutive_monthR Documentation

Find the current month number relative to a starting date

Description

Sometimes it's helpful to be able to break down elapsed time in more granular units, like being able to say, "I am in the 15th month of this experiment."

Usage

consecutive_month(from, to)

Arguments

from

(Character or Numeric) A date in the ISO-8601 form "YYYY-MM-DD", or a single number for the year which implies YYYY-01-01.

to

(Character) A date in the ISO-8601 form YYYY-MM-DD.

Value

A numeric vector for the number of months elapsed.

Authors

Examples

# These are the same thing.
consecutive_month(2015, "2016-02-04")
consecutive_month("2015-01-01", "2016-02-04")
#> [1] 14

consecutive_month("2015-02-01", "2016-02-04")
#> [1] 13


DesiQuintans/desiderata documentation built on April 9, 2023, 5:43 a.m.