Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

date2days

Convert date to day count


Description

Convert date mm/dd/yyyy to days since the 1st of startmonth, starting with days = 1 for the 1st day of startmonth.

Usage

date2days(date, dateformat, startmonth)

Arguments

date

date character string with format as specified in dateformat

dateformat

string specifying format of date, e.g. "mm/dd/yyyy", "yyyy-dd-mm", "dd–mm" etc.

startmonth

integer between 1 and 12 indicating month from which to start counting.

Value

Returns an integer = number of days since 1st of startmonth, starting with 1 = 1st of startmonth.

Author(s)

Bo T. Bonnevie

Examples

date2days("01/01/2010", "dd/mm/yyyy", 1)
date2days("01-01-2010", "dd-mm-yyyy", 2)
date2days("2008/06/01", "yyyy/mm/dd", 8)    # year has no effect

moult

Models for Analysing Moult in Birds

v2.1.0
GPL-2
Authors
Birgit Erni <birgit.erni@uct.ac.za>. Based on models developed by Underhill and Zucchini (1988, 1990).
Initial release
2017-12-20

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.