2024-02-05 14:46:02 +01:00
|
|
|
% Generated by roxygen2: do not edit by hand
|
|
|
|
% Please edit documentation in R/ds2ical.R
|
|
|
|
\name{ds2ical}
|
|
|
|
\alias{ds2ical}
|
|
|
|
\title{Convert data set to ical file}
|
|
|
|
\usage{
|
|
|
|
ds2ical(
|
|
|
|
data,
|
2024-02-05 21:34:16 +01:00
|
|
|
start = start,
|
|
|
|
end = end,
|
|
|
|
location = location,
|
2024-02-05 14:46:02 +01:00
|
|
|
summary.glue.string = "ID {id} [{assessor}]",
|
2024-02-05 21:34:16 +01:00
|
|
|
description.glue.string = NULL
|
2024-02-05 14:46:02 +01:00
|
|
|
)
|
|
|
|
}
|
|
|
|
\arguments{
|
|
|
|
\item{data}{data set}
|
|
|
|
|
2024-02-05 21:34:16 +01:00
|
|
|
\item{start}{dplyr style event start datetime column name}
|
2024-02-05 14:46:02 +01:00
|
|
|
|
2024-02-05 21:34:16 +01:00
|
|
|
\item{end}{dplyr style event end datetime column name}
|
|
|
|
|
|
|
|
\item{location}{dplyr style event location column name}
|
2024-02-05 14:46:02 +01:00
|
|
|
|
|
|
|
\item{summary.glue.string}{character string to pass to glue::glue() for event
|
|
|
|
name (summary). Can take any column from data set.}
|
|
|
|
|
|
|
|
\item{description.glue.string}{character string to pass to glue::glue() for
|
|
|
|
event description. Can take any column from data set.}
|
|
|
|
}
|
|
|
|
\value{
|
|
|
|
tibble of class "ical"
|
|
|
|
}
|
|
|
|
\description{
|
|
|
|
Convert data set to ical file
|
|
|
|
}
|
|
|
|
\examples{
|
|
|
|
df <- dplyr::tibble(start = c(Sys.time(), Sys.time() + lubridate::days(2)),
|
2024-02-05 21:34:16 +01:00
|
|
|
id = c("1", 3), assessor = "A", location = "111", note = c(NA, "OBS")) |>
|
|
|
|
dplyr::mutate(end= start+lubridate::hours(2))
|
|
|
|
df |> ds2ical()
|
|
|
|
df |> ds2ical(summary.glue.string = "ID {id} [{assessor}] {note}")
|
2024-02-05 14:46:02 +01:00
|
|
|
# Export .ics file: (not run)
|
2024-02-05 21:34:16 +01:00
|
|
|
ical <- df |> ds2ical(start, end, location, description.glue.string = "{note}")
|
2024-02-05 14:46:02 +01:00
|
|
|
# ical |> calendar::ic_write(file=here::here("calendar.ics"))
|
|
|
|
}
|