extract_ymd: Extract YMD components from a date

Description Usage Arguments Examples

View source: R/utils.R

Description

Extracts a triple of year, month, day from date(s). If a single date is provided, useful with zeallot package's multi-assignment operator. If multiple dates are provided, a tibble of components (as columns) are returned, which can be used with purrr's multi-column mappings.

Usage

1

Arguments

x

Date vector

Examples

1
2
3
4
5
6
## Not run: 
library(zeallot)

c(year, month, day) %<-% extract_ymd(Sys.Date())

## End(Not run)

wikimedia/wmfdata-r documentation built on Feb. 3, 2021, 3:45 p.m.