Skip to contents

Filter calendar events to match the extent on the calendar

Usage

filter_events(
  data,
  year = format(Sys.Date(), "%Y"),
  month = format(Sys.Date(), "%m"),
  format = "%Y-%m-%d",
  weekend = FALSE
)

Arguments

data

a data.frame with at least the following columns: from, the start of the event, to, the end of the event, name, the name of the event, and category, the category of the event (used for different colors).

year

either an integer or a character of length 1. Must have 4 characters (e.g. '2024' and not '24'). Default is the current year.

month

either an integer or a character of length 1. Must have 1 or 2 characters (e.g. '01' or '1'). Default is the current month.

format

a character of length 1. Used to specify the format of the date. Default is "%Y-%m-%d" (i.e. 2024-12-25).

weekend

a logical. If TRUE keeps Saturdays and Sundays. Default is FALSE.

Value

A data.frame, same as the input but with only events matching the extent on the calendar.

Examples

## No example ---