Transform a Year into a Date
year2Date.Rd
Transform a year given as a string into a date corresponding either the beginning of the year ot the begining of the following year.
Usage
year2Date(str, type = c("start", "end"))
Arguments
- str
A character string.
- type
The type of date to return. This has only an effect when only the year is given, as oppposed to a full date. Then, when
type
is"start"
, the characterstr
is expected to describe the beginning of a time range and the returned date will be the beginning of the year. When insteadtype
is"end"
, the characterstr
is expected to describle the end of a time range and the returned date will be the beginning of the next year. See Examples.