Learn R Programming

DDM (version 1.0-0)

ypart: determine the proportion of a year passed as of a particular date

Description

The fraction returned by this is used e.g. for intercensal estimates. Function uses 'lubridate' package to handle dates elegantly.

Usage

ypart(Year, Month, Day, reproduce.matlab = TRUE, detect.mid.year = FALSE,
  detect.start.end = TRUE)

Arguments

Year
4-digit year (string or integer)
Month
month digits (string or integer, 1 or 2 characters)
Day
Day of month digits (string or integer, 1 or 2 characters)
reproduce.matlab
logical. Default TRUE. Assume 365 days in a year.
detect.mid.year
logical. if TRUE, June 30 or July 1 will always return .5.
detect.start.end
logical. default TRUE. Should Jan 1 always be 0 and Dec 31 always be 1?