ggweek_planner: Create a Weekly Planner

Description Usage Arguments Value Examples

View source: R/ggweekly.R

Description

Creates a weekly calendar with ggplot2

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
ggweek_planner(start_day = lubridate::today(), end_day = start_day +
  lubridate::weeks(8) - lubridate::days(1), highlight_days = NULL,
  week_start = c("isoweek", "epiweek"),
  week_start_label = c("month day", "week", "none"),
  show_day_numbers = TRUE, show_month_start_day = TRUE,
  show_month_boundaries = TRUE, highlight_text_size = 2,
  month_text_size = 4, day_number_text_size = 2,
  month_color = "#f78154", day_number_color = "grey80",
  weekend_fill = "#f8f8f8", holidays = ggweekly::us_federal_holidays,
  font_base_family = "PT Sans", font_label_family = "PT Sans Narrow",
  font_label_text = NULL)

Arguments

start_day

The starting day, either as a YYYY-mm-dd text string or using lubridate::ymd().

end_day

The ending day, either as a YYYY-mm-dd text string or using lubridate::ymd().

highlight_days

Special days to be highlighted, formatted as a tibble with columns day, label, color, and fill.

week_start

Should the week start on Monday ("isoweek") or on Sunday ("epiweek")?

week_start_label

What labels should be used for the week start, i.e. to the left of the first day of the week? One of "month day", "week", or "none".

show_day_numbers

Should day numbers be included in each box of the calendar?

show_month_start_day

Should the first day of the month be highlighted?

show_month_boundaries

Should boundaries between months be highlighted with a dotted line?

highlight_text_size

Size of the text in the highlighted days.

month_text_size

The size of the text labelling the first day of the month.

day_number_text_size

The size of the text labelling day number.

month_color

The color of the boxes highlighting the first day of the month.

day_number_color

The color of the day number text.

weekend_fill

The color to fill the weekend days.

holidays

A tibble containing holiday dates in the same format as higlight_days. Defaults to a list of US Federal Holidays. Set to NULL to disable.

font_base_family

Base font passed to base_family in ggplot2::theme_minimal, default is "PT Sans".

font_label_family, font_label_text

Font for label text, default is PT Sans Narrow. Note that font_label_text is deprecated in favor of font_label_family.

Value

A ggplot2 object with the weekly calendar plot.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 
# Create a weekly planner
ggweek_planner(
  start_day = "2019-04-01",
  end_day = "2019-06-30",
)

# Create a standard calendar
ggweek_planner(
  start_day = "2019-04-01",
  end_day = "2019-06-30",
  show_month_boundaries = FALSE,
  show_month_start_day = FALSE,
  week_start = "isoweek",
  week_start_label = "week"
) +
  ggplot2::ggtitle("2019") +
  ggplot2::facet_wrap(~ month, scales = 'free')

## End(Not run)

gadenbuie/ggweekly documentation built on Sept. 15, 2020, 2:23 a.m.