calendar | R Documentation |
Create a table of common time units from a date or datetime sequence.
calendar(
x,
label = TRUE,
week_start = getOption("lubridate.week.start", 1),
fiscal_start = getOption("lubridate.fiscal.start", 1),
name = "time"
)
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. |
An object of class tibble
.
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, "day")
calendar(my_seq)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.