int_to_year: int_to_year

Description Usage Arguments Value Author(s) Examples

View source: R/utility_functions.r

Description

Convert an integer to a date.

Usage

1
int_to_year(x, month = "06", day = "15")

Arguments

x

An integer or vector integers.

month

The month to be added to the year. Months 1 to 9 should be given as character strings, i.e. "01", "02", etc, and not 1 or 2o, etc.

day

The day to be added to the year. Days should be given as character strings, i.e., "01" or "02", etc, and not 1 or 2, etc.

Value

A vector of dates where the input integer forms the year component. The day and month components added will by default be the 15th of June, so that tick marks will appear in the middle of the series on plots. For input, only years 0:9999 are accepted.

Author(s)

Kieran Healy

Examples

1
2
3
4
int_to_year(1960)
class(int_to_year(1960))
int_to_year(1960:1965)
int_to_year(1990, month = "01", day = "30")

kjhealy/socviz documentation built on July 20, 2020, 7:36 a.m.