format.ymon: Format a ymon

Description Usage Arguments Examples

View source: R/ymon-print.R

Description

The ymon format() method is purposefully implemented without a format = argument, and always prints as YYYY-MM. To use a custom format, the ymon would have to be converted to POSIXlt, which is a very slow operation. It is also buggy when outside the year range of 0-9999 because strptime doesn't support it. If you want to use a custom format, convert to Date first with as.Date(), and then format that.

Usage

1
2
## S3 method for class 'ymon'
format(x, ...)

Arguments

x

A ymon.

...

Unused.

Examples

1
2
3
4
5
format(ymon(2019, 01))

# NA values are printed as the actual character string
# for better behavior when combined with `print(format(x), quote = FALSE)`.
format(ymon(NA, NA))

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