first_of_yw() is equivalent with first_of_isoweek() and only included for symmetry with first_of_yq() and first_of_ym().

first_of_isoweek(x)

# S3 method for default
first_of_isoweek(x)

last_of_isoweek(x)

# S3 method for default
last_of_isoweek(x)

first_of_yw(x, w = NULL)

last_of_yw(x, w = NULL)

Arguments

x

Anything that can be coerced to a date with base::as.Date()

w

Two integer (vectors). w is optional and the interpretation of x will depend on whether w is supplied or not:

  • if only x is supplied, x will be passed to as_date_yw() (e.g. x = 201604 means 4th isoweek of 2016)

  • if x and w are supplied, x is interpreted as year and w as week.

Value

a Date

See also

first_of_isoweek()

Examples

first_of_isoweek("2016-06-04")
#> [1] "2016-05-30"
last_of_isoweek("2016-06-04")
#> [1] "2016-06-05"
first_of_yw(2016)
#> [1] "20-04-13"
first_of_yw(2016)
#> [1] "20-04-13"