to_date: Make a Date from year, month, day

Description Usage Arguments Details Value Note Examples

Description

This function makes a Date from the supplied year, month, and day paramters. NA values for month and day are replaced by 1.

Usage

1
to_date(year, month, day)

Arguments

year

Numeric year

month

Numeric month

day

Numeric day

Details

Currently requires year to be >= 0.

Value

A Date object

Note

This function is for internal use only.

Examples

1
2
3
earthquakes:::to_date(2017, 4, 17)  # => 2017-04-17
earthquakes:::to_date(2017, 4, NA)  # => 2017-04-01
earthquakes:::to_date(2017, NA, NA) # => 2017-01-01

davidbody/earthquakes-package documentation built on May 14, 2019, 10:37 p.m.