max_cycle_length: Calculate the Maximum Possible Value of a Time Cycle
Description
This function returns the maximum possible value that a specific time
component can take, given a cycle length and scale.
Usage
max_cycle_length(cycle_length, time_scale)
Value
The function returns the maximum possible value that the time_scale
can take within one cycle_length.
Arguments
cycle_length
A character string indicating the larger unit of time.
It must be one of "year", "month", "day", "hour", "minute".
time_scale
A character string indicating the smaller unit of time,
which is a division of the cycle_length. If cycle_length is "year",
time_scale can be one of "month", "day", "hour", "minute", "second".
If cycle_length is "month", time_scale can be "day", "hour", "minute",
"second", and so on.
max_cycle_length("year", "month") # Maximum months is a year 12max_cycle_length("day", "minute") # Maximum minutes in a day 1440max_cycle_length("year", "day") # Maximum days in a year 366