anniversary {ThomasJeffersonUniv}R Documentation

Number of Anniversaries Between Two Dates

Description

Number of anniversaries between two dates.

Usage

anniversary(to, from)

Arguments

to

an R object convertible to POSIXlt, end date/time

from

an R object convertible to POSIXlt, start date/time

Details

  1. Year difference between from and to dates are calculated

  2. In either situation below, subtract one (1) year from the year difference obtained in Step 1.

    • Month of from is later than month of to;

    • Months of from and to are the same, but day of from is later than day of to.

    In either of such situations, the anniversary of the current year has not been reached.

  3. If any element from Step 2 is negative, stop.

Value

Function anniversary returns an integer scalar or vector.


[Package ThomasJeffersonUniv version 0.1.2 Index]