dategrp: Date group numbers

View source: R/date_funcs.R

dategrpR Documentation

Date group numbers

Description

This assigns a date or date vector to a corresponding group of dates of some length in a given year. This is a helper function for making composites. The group is calculated from day 1 of the year. If no group length entered, this just uses the lubridate::week() function (7-day week length)

Usage

dategrp(dateval, grp_length)

Arguments

dateval

Date string or date formatted with as.Date()

grp_length

Number indicating length of group of days

Value

numeric value of "week" number

Examples

dategrp(dateval = "2020-03-27")
dategrp(dateval = c("2020-03-27","2020-04-27"), grp_length = 4)

BIO-RSG/oceancolouR documentation built on April 30, 2024, 7:54 a.m.