I want to create calendars from tabular and computed data in R. This works well using package toastui, especially as it can be embedded in web pages generated with RMarkdown or Quarto. Now, I would also like to export it in ics
/ical
format. Is there a common way or another package in R to get something like this?
library("toastui")
library("tibble")
library("lubridate")
## table of events
events <- tribble(
~title, ~start, ~end, ~category,
"Guest talk", "2023-03-07 15:00", "2023-03-07 17:00", "time",
"Field Course", "2023-03-01 00:00", "2023-03-03 00:00", "allday",
"Holidays", "2023-03-27 00:00", "2023-03-31 00:00", "allday") |>
mutate(start = as.POSIXct(start), end=as.POSIXct(end))
## computational dates
regular <- tibble(
title = "Weekly meeting",
start = seq(as.POSIXct("2023-03-10 10:00 "),
as.POSIXct("2023-04-01 10:00 "), by= "1 week"),
end = seq(as.POSIXct("2023-03-10 12:00 "),
as.POSIXct("2023-04-01 12:00 "), by= "1 week "),
category = "time"
)
## create toastui calendar
bind_rows(events, regular) |>
calendar(useDetailPopup = TRUE, navigation = TRUE, defaultDate = "2023-03-16")