days_since_month: Calculate days from a given calendar month

Description Usage Arguments Details Value Examples

View source: R/days_since_month.R

Description

An a-historical method to calculate pentades by calculating distance from a given calendar month.

Usage

1
days_since_month(date, start_month = 7)

Arguments

date

A 'date' object. This can be a single date or a vector of dates.

start_month

An integer between 1 and 12 (inclusive) that indicates the month you want to measure distance in days from. Default is 7.

Details

This functions assumes that all years are 365 days. Necessary corrections for leap years are made.

Value

This function returns an integer between 1 and 365 indicating the number of days elapsed since the first of the month indicated in 'start_month'

Examples

1
2
3
4
5
6
# single date conversion example
days_since_month(date = as.Date('2018-09-14'), start_month = 7)

# multiple dates conversion examples
sequence_of_dates <- c(as.Date("2019-01-01"), as.Date("2019-03-19"))
days_since_month(date = sequence_of_dates, start_month = 6)

davidclarance/africabirdmap documentation built on Sept. 3, 2019, 12:34 p.m.