sh_round {shide}R Documentation

Round Jalali dates to a specific unit of time

Description

Usage

sh_round(x, unit = NULL, ...)

sh_floor(x, unit = NULL, ...)

sh_ceiling(x, unit = NULL, ...)

Arguments

x

A vector of jdate objects.

unit

Valid units are day, week, month, quarter, and year. If NULL, defaults to day.

...

These dots are for future extensions and must be empty.

Value

A vector of jdate objects with the same length as x.

See Also

lubridate::round_date()

Examples

x <- jdate("1402-12-15")
sh_floor(x, "year")
sh_ceiling(x, "year")
sh_round(x, "year")
sh_round(x, "week") == sh_floor(x, "week")
sh_round(x + 1, "week") == sh_ceiling(x, "week")

[Package shide version 0.2.0 Index]