as_ymon: Coerce to year month

Description Usage Arguments Examples

View source: R/ymon-as.R

Description

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
as_ymon(x, ...)

## S3 method for class 'Date'
as_ymon(x, ...)

## S3 method for class 'POSIXct'
as_ymon(x, ...)

## S3 method for class 'POSIXlt'
as_ymon(x, ...)

## S3 method for class 'integer'
as_ymon(x, ...)

## S3 method for class 'double'
as_ymon(x, ...)

## S3 method for class 'character'
as_ymon(x, ...)

Arguments

x

[vector]

An object to coerce to ymon.

...

Not used.

Examples

1
2
3
4
5
6
7
# Extra information such as days, hours, or time zones are dropped
as_ymon(as.Date("2019-05-03"))
as_ymon(as.POSIXct("2019-03-04 01:01:01", tz = "America/New_York"))

# Integers are interpreted as the number of months since 1970-01-01
as_ymon(0L)
as_ymon(12L)

DavisVaughan/datea documentation built on April 10, 2020, 12:03 a.m.