cut_date: Split dates into periods within each year

View source: R/cut_date.R

cut_dateR Documentation

Split dates into periods within each year

Description

The periods are defined by a day and month. The same day from different years with be in the same period.

Usage

cut_date(x, dm, include_last = TRUE)

Arguments

x

the dates in POSIXt or Date format.

dm

the breakpoints of the periods in 'day-month' format.

include_last

Should the last period include the last day? Defaults to TRUE.

Examples

x <- as.POSIXct(
    c(
    "2015-01-01", "2014-01-02", "2013-01-03", "2012-01-31", "2011-02-01",
    "2012-12-31"
   )
)
cut_date(x, dm = c("1-1", "1-2", "1-3"))

INBO-Natura2000/n2khelper documentation built on April 5, 2022, 5:40 p.m.