Coerce and Format to Year-Isoweek Strings
format_yw(x, w = NULL, format = "%Y-W%V")
x, w | Two integer (vectors).
|
||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
format | A format that uses a subset of the same placeholders as
Not all placeholders are supported for all |
a character
vector
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")
)
format_yw(2015, 5)#> [1] "2015-W05"format_yw(201505, format = "%Y.%V")#> [1] "2015.05"#> [1] "15.05"