calendar {timeplyr} | R Documentation |
Create a table of common time units from a date or datetime sequence.
Description
Create a table of common time units from a date or datetime sequence.
Usage
calendar(
x,
label = TRUE,
week_start = getOption("lubridate.week.start", 1),
fiscal_start = getOption("lubridate.fiscal.start", 1),
name = "time"
)
Arguments
x |
date or datetime vector. |
label |
Logical. Should labelled (ordered factor) versions of
week day and month be returned? Default is |
week_start |
day on which week starts following ISO conventions - 1
means Monday, 7 means Sunday (default). When |
fiscal_start |
Numeric indicating the starting month of a fiscal year. |
name |
Name of date/datetime column. |
Value
An object of class tibble
.
Examples
library(timeplyr)
library(lubridate)
# Create a calendar for the current year
from <- floor_date(today(), unit = "year")
to <- ceiling_date(today(), unit = "year", change_on_boundary = TRUE) - days(1)
my_seq <- time_seq(from, to, time_by = "day")
calendar(my_seq)
[Package timeplyr version 0.8.1 Index]