zip_dates: zip_dates

View source: R/zip_dates.R

zip_datesR Documentation

zip_dates

Description

zip_dates

Usage

zip_dates(dates, by = NULL, format = NULL, check_duplicate = FALSE)

Arguments

dates

Date vector

by

increment of the sequence, could be one of 'day', 'month' and 'year'.

format

character string.

check_duplicate

If true, duplicated formated dates by 'format' will be removed. If by = 'month' or 'year', suggest setting check_duplicate as TRUE.

Examples

library(lubridate)
data("station_HisPos")
d <- station_HisPos[site == 50136, ]
dates <- d[, make_date(year, month, day)]

s1 <- zip_dates(dates)
s2 <- zip_dates(dates, by = "year", check_duplicate = TRUE)

kongdd/MissInfo documentation built on Jan. 14, 2024, 2:22 a.m.