This function allows you to the week number in one year for a given date

week_of_the_year(date)

Arguments

date

date

Value

a number

Examples

library("lubridate")
#> #> Attaching package: ‘lubridate’
#> The following object is masked from ‘package:base’: #> #> date
week_of_the_year(date = today())
#> [1] 15
week_of_the_year(date = as.Date("2015-10-21"))
#> [1] 43
week_of_the_year(seq(as.Date("1990-12-31"), as.Date("2015-12-31"), by = "year"))
#> [1] 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 54 53 53 #> [26] 53