| format_ym {dint} | R Documentation |
Coerce and Format to Year-Month Strings
Description
Coerce and Format to Year-Month Strings
Usage
format_ym(x, m = NULL, format = "%Y-M%m")
Arguments
x, m |
Two integer (vectors).
| ||||||||||||
format |
A format that uses a subset of the same placeholders as
Not all placeholders are supported for all |
Value
a character vector
Formatting shorthands
Format shorthand functions in the form of format_y*_[preset]() directly
apply formatting presets to anything that can be coerced to a date_xx.
This is notably handy as they can be used as a labeling function for
ggplot2 axes (see vignette("dint"))
See Also
Other coerce and format functions:
format_yq(),
format_yw()
Examples
format_ym(2015, 5)
format_ym(201505, format = "short")
format_ym(201505, format = "shorter")