Skip to contents

cal_add_task(), cal_set_project(), and the other functions here are convenience functions that allow a piped workflow with calendario objects

Usage

cal_new(...)

cal_set_project(x, ...)

cal_set_defaults(x, ...)

cal_get_defaults(x, ...)

cal_add_task(x, ...)

cal_get_tasks(x, ...)

cal_get_workload(x, ...)

cal_get_calendar(x, ...)

Arguments

...

Arguments to be passed to the relevant R6 method

x

A calendario object

Value

The calendario object. For all functions except cal_new() the object is returned invisibly

Details

These functions are wrappers around one of the calendario object methods: cal_add_task() is a wrapper around $add_task(), cal_set_project() is a wrapper around $set_project() and so on. In all cases the functions take a calendario object x as their first argument, and all other arguments are passed via ... to the relevant calendario R6 method. The one exception to this rule is cal_new(), for which ... is the only argument.

Examples

cal <- cal_new()
cal |>
  cal_set_project("project-name") |>
  cal_add_task("description-1", "29 may") |>
  cal_add_task("description-2", "1 jun")

cal_get_workload(cal)
cal_get_tasks(cal)