Title: | Clinical Stroke Research |
---|---|
Description: | A collection of tools for clinical trial data management and analysis in research and teaching. The package is mainly collected for personal use, but any use beyond that is encouraged. This package has migrated functions from 'agdamsbo/daDoctoR', and new functions has been added. Version follows months and year. See NEWS/Changelog for release notes. This package includes sampled data from the TALOS trial (Kraglund et al (2018) <doi:10.1161/STROKEAHA.117.020067>). The win_prob() function is based on work by Zou et al (2022) <doi:10.1161/STROKEAHA.121.037744>. The age_calc() function is based on work by Becker (2020) <doi:10.18637/jss.v093.i02>. |
Authors: | Andreas Gammelgaard Damsbo [aut, cre] |
Maintainer: | Andreas Gammelgaard Damsbo <[email protected]> |
License: | GPL-3 |
Version: | 24.10.1 |
Built: | 2024-10-26 03:40:10 UTC |
Source: | CRAN |
MOVED Add padding to string
add_padding( d, length = NULL, after = FALSE, pad = "0", lead = NULL, tail = NULL )
add_padding( d, length = NULL, after = FALSE, pad = "0", lead = NULL, tail = NULL )
d |
vector of strings or numbers |
length |
final string length |
after |
if padding should be added after as opposed to default before |
pad |
padding string of length 1 |
lead |
leading string for all. Number or character vector. Cycled. |
tail |
tailing string for all. Number or character vector. Cycled. |
vector or character strings of same length.
add_padding(sample(1:200,5),tail="AA",lead=c(2,3,"e"))
add_padding(sample(1:200,5),tail="AA",lead=c(2,3,"e"))
Calculate age in years, months, or days
age_calc(dob, enddate = Sys.Date(), units = "years", precise = TRUE)
age_calc(dob, enddate = Sys.Date(), units = "years", precise = TRUE)
dob |
Date of birth |
enddate |
End date for age calculation (default is Sys.Date()) |
units |
Units for age calculation (default is "years"). Can be c("days", "months", "years") |
precise |
Option to calculate age precisely (default is TRUE) |
numeric vector length 1
Becker, J.P. (2020). eeptools: An R Package for Teaching and Learning Ecology and Evolutionary Biology. Journal of Statistical Software, 93(2), 1-27.
trunc(age_calc(as.Date("1945-10-23"),as.Date("2018-09-30")))
trunc(age_calc(as.Date("1945-10-23"),as.Date("2018-09-30")))
MOVED Split to chunks of size n
chunks_of_n(d, n, label = NULL, even = FALSE, pattern = NULL)
chunks_of_n(d, n, label = NULL, even = FALSE, pattern = NULL)
d |
data. Can be vector or data frame. |
n |
number of chunks |
label |
naming prefix for chunk names |
even |
boolean to set if size of chunks should be evenly distributed. |
pattern |
regex pattern to extract names from provided vector. If data frame, will assume first column is name. |
List of length n
tail(chunks_of_n(seq_len(100),7),3) tail(chunks_of_n(seq_len(100),7,even=TRUE),3) ds <- data.frame(nm=paste0("Sub", add_padding(rownames(stRoke::talos))),stRoke::talos) head(chunks_of_n(ds,7,pattern="Sub[0-9]{3}",label="grp"),2) ## Please notice that no sorting is performed. This is on purpose to preserve ## original sorting. If sorting is intended, try something like this: ds[order(ds$nm),] |> chunks_of_n(7,pattern="Sub[0-9]{3}",label="grp") |> head(2)
tail(chunks_of_n(seq_len(100),7),3) tail(chunks_of_n(seq_len(100),7,even=TRUE),3) ds <- data.frame(nm=paste0("Sub", add_padding(rownames(stRoke::talos))),stRoke::talos) head(chunks_of_n(ds,7,pattern="Sub[0-9]{3}",label="grp"),2) ## Please notice that no sorting is performed. This is on purpose to preserve ## original sorting. If sorting is intended, try something like this: ds[order(ds$nm),] |> chunks_of_n(7,pattern="Sub[0-9]{3}",label="grp") |> head(2)
Horizontal forest plot of point estimate with confidence intervals. Includes dichotomous or olr, depending on number of levels in "x". Title and axis labels can be added to the ggplot afterwards.
ci_plot( ds, x = NULL, y = NULL, vars = NULL, dec = 3, lbls = NULL, title = NULL, method = "auto" )
ci_plot( ds, x = NULL, y = NULL, vars = NULL, dec = 3, lbls = NULL, title = NULL, method = "auto" )
ds |
main input, either data set or logistic model |
x |
text string of main exposure variable |
y |
text string of outcome variable |
vars |
variables for multivariate analysis. |
dec |
Decimals in labels |
lbls |
Labels for variable names |
title |
Plot title. Can be specified later. |
method |
Character vector. The method for the regression. Can be c("auto", "model"). |
ggplot element
# Auto plot data(talos) talos[,"mrs_1"]<-factor(talos[,"mrs_1"],ordered=TRUE) ci_plot(ds = talos, x = "rtreat", y = "mrs_1", vars = c("hypertension","diabetes")) ## Model plot # iris$ord<-factor(sample(1:3,size=nrow(iris),replace=TRUE),ordered=TRUE) # lm <- MASS::polr(ord~., data=iris, Hess=TRUE, method="logistic") # ci_plot(ds = lm, method="model")
# Auto plot data(talos) talos[,"mrs_1"]<-factor(talos[,"mrs_1"],ordered=TRUE) ci_plot(ds = talos, x = "rtreat", y = "mrs_1", vars = c("hypertension","diabetes")) ## Model plot # iris$ord<-factor(sample(1:3,size=nrow(iris),replace=TRUE),ordered=TRUE) # lm <- MASS::polr(ord~., data=iris, Hess=TRUE, method="logistic") # ci_plot(ds = lm, method="model")
Plots color examples with contrasting text. Parameters are passed to contrast_text.
color_plot( colors, labels = TRUE, borders = NULL, cex_label = 1, ncol = NULL, ... )
color_plot( colors, labels = TRUE, borders = NULL, cex_label = 1, ncol = NULL, ... )
colors |
Vector of colors to plot |
labels |
Show color names. Default is TRUE |
borders |
Border parameter for 'rect()' function. Default is NULL |
cex_label |
Label size. Default is 1. |
ncol |
Desired number of columns. Default is ceiling of square root to the length of 'colors' vector provided. |
... |
Parameters for the |
base plot
par(bg=NULL) colors <- sample(colors(),size = 20) color_plot(colors, method="relative")
par(bg=NULL) colors <- sample(colors(),size = 20) color_plot(colors, method="relative")
Calculates the best contrast text color for a given background color.
contrast_text( background, light_text = "white", dark_text = "black", threshold = 0.5, method = "perceived_2", ... )
contrast_text( background, light_text = "white", dark_text = "black", threshold = 0.5, method = "perceived_2", ... )
background |
A hex/named color value that represents the background. |
light_text |
A hex/named color value that represents the light text color. |
dark_text |
A hex/named color value that represents the dark text color. |
threshold |
A numeric value between 0 and 1 that is used to determine the luminance threshold of the background color for text color. |
method |
A character string that specifies the method for calculating the luminance. Three different methods are available: c("relative","perceived","perceived_2") |
... |
parameter overflow. Ignored. |
This function aids in deciding the font color to print on a given background. The function is based on the example provided by teppo: https://stackoverflow.com/a/66669838/21019325. The different methods provided are based on the methods outlined in the StackOverflow thread: https://stackoverflow.com/questions/596216/formula-to-determine-perceived-brightness-of-rgb-color
A character string that contains the best contrast text color.
contrast_text(c("#F2F2F2", "blue")) contrast_text(c("#F2F2F2", "blue"), method="relative")
contrast_text(c("#F2F2F2", "blue")) contrast_text(c("#F2F2F2", "blue"), method="relative")
Checking validity of cpr number. Vectorised.
cpr_check(cpr)
cpr_check(cpr)
cpr |
cpr-numbers as ddmmyy"-."xxxx or ddmmyyxxxx. Also mixed formatting. Vector or data frame column. |
Logical vector of cpr validity
fsd<-c("2310450637", "010190-2000", "010115-4000", "300450-1030","010150-4021") cpr_check("2310450637") cpr_check(fsd) all(cpr_check(fsd))
fsd<-c("2310450637", "010190-2000", "010115-4000", "300450-1030","010150-4021") cpr_check("2310450637") cpr_check(fsd) all(cpr_check(fsd))
For easy calculation. Does not handle cprs with letters (interim cpr)
cpr_dob(cpr, format = "%d-%m-%Y")
cpr_dob(cpr, format = "%d-%m-%Y")
cpr |
cpr-numbers as ddmmyy"-."xxxx or ddmmyyxxxx. Also mixed formatting. Vector or data frame column. |
format |
character string of dob date format. Default is "%d-%m-%Y". |
character vector
cpr_dob("231045-0637") fsd<-c("2310450637", "010190-2000", "010115-4000", "300450-1030","010150-4021") cpr_dob(fsd)
cpr_dob("231045-0637") fsd<-c("2310450637", "010190-2000", "010115-4000", "300450-1030","010150-4021") cpr_dob(fsd)
Just checking if last number of a string is equal or not.
cpr_female(cpr)
cpr_female(cpr)
cpr |
Vector. cpr-numbers as ddmmyy"-."xxxx or ddmmyyxxxx. Also mixed formatting. Vector or data frame column. |
Logical vector
cpr_female(stRoke::cprs[,1])
cpr_female(stRoke::cprs[,1])
This is just a repeated sample of 8 synthesized cpr-numbers for testing purposes.
data(cprs)
data(cprs)
A data frame with 200 rows and 1 variable:
Mixed format cpr-numbers, characters
https://da.wikipedia.org/wiki/231045-0637
DEPRECATED Moved to REDCapCAST::ds2dd() | Data set to data dictionary function
ds2dd( ds, record.id = "record_id", form.name = "basis", field.type = "text", field.label = NULL, include.column.names = FALSE, metadata = stRoke::metadata_names )
ds2dd( ds, record.id = "record_id", form.name = "basis", field.type = "text", field.label = NULL, include.column.names = FALSE, metadata = stRoke::metadata_names )
ds |
data set |
record.id |
name or column number of id variable, moved to first row of data dictionary, character of integer. Default is "record_id". |
form.name |
vector of form names, character string, length 1 or length equal to number of variables. Default is "basis". |
field.type |
vector of field types, character string, length 1 or length equal to number of variables. Default is "text. |
field.label |
vector of form names, character string, length 1 or length equal to number of variables. Default is NULL and is then identical to field names. |
include.column.names |
Flag to give detailed output including new column names for original data set for upload. |
metadata |
Metadata dataframe. Default is the included stRoke::metadata_names. |
data.frame or list of data.frame and vector
talos$id <- seq_len(nrow(talos)) ds2dd(talos, record.id="id",include.column.names=FALSE)
talos$id <- seq_len(nrow(talos)) ds2dd(talos, record.id="id",include.column.names=FALSE)
This function filters files in a folder based on the provided filter.
files_filter(folder.path, filter.by, full.names = TRUE)
files_filter(folder.path, filter.by, full.names = TRUE)
folder.path |
character. Path of the folder to be filtered |
filter.by |
character. Filter to be applied on the files |
full.names |
logical. Whether to return full file names or not |
character vector. Filtered files
# Gives path to files/folders with "tests" in the name in the # working directory files_filter(getwd(),"tests")
# Gives path to files/folders with "tests" in the name in the # working directory files_filter(getwd(),"tests")
Includes table 1, grotta bars and ordinal logistic regression plot. Please just use this function for illustration purposes. To dos: modify grottaBar and include as own function.
generic_stroke(df, group, score, strata = NULL, variables = NULL)
generic_stroke(df, group, score, strata = NULL, variables = NULL)
df |
Data set as data frame |
group |
Variable to group by |
score |
Outcome measure variable |
strata |
Optional variable to stratify by |
variables |
String of variable names to include in adjusted OLR-analysis |
Returns list with three elements
# generic_stroke(df = stRoke::talos, group = "rtreat", score = "mrs_6", # variables = c("hypertension","diabetes","civil"))
# generic_stroke(df = stRoke::talos, group = "rtreat", score = "mrs_6", # variables = c("hypertension","diabetes","civil"))
Plot index scores from five dimensional cognitive testing. Includes option to facet.
index_plot( ds, id = "id", sub_plot = "_is", scores = c("_is", "_lo", "_up", "_per"), dom_names = c("immediate", "visuospatial", "verbal", "attention", "delayed", "total"), facet.by = NULL )
index_plot( ds, id = "id", sub_plot = "_is", scores = c("_is", "_lo", "_up", "_per"), dom_names = c("immediate", "visuospatial", "verbal", "attention", "delayed", "total"), facet.by = NULL )
ds |
complete data frame |
id |
colname of id column. Base for colouring |
sub_plot |
main outcome scores variable to plot |
scores |
variables to subset for plotting. Has to follow standard naming (is to be changed) |
dom_names |
domain names for axis naming |
facet.by |
variable to base facet_grid on |
ggplot element
index_plot(stRoke::score[score$event=="A",])
index_plot(stRoke::score[score$event=="A",])
Function to select labels from list of label pairs (format: age~"Age"
).
Alternative is to use attributes, eg from library(Hmisc)
.
label_select(lst, vec)
label_select(lst, vec)
lst |
List of variables and labels (format: |
vec |
Vector of variables to be subset from the list |
List of labels ordered like vec, formatted like lst
vars<-c("hypertension", "diabetes", "mrs_1") labels_all<-list(rtreat~"Trial treatment", civil~"Cohabitation", diabetes~"Known diabetes", hypertension~"Known hypertension", mrs_1~"One month mRS", mrs_6~"Six months mRS", '[Intercept]'~"Intercept") label_select(labels_all,vars) ## With gtsummary::tbl_summary() #stRoke::talos[vars] |> #gtsummary::tbl_summary(label = label_select(labels_all,vars))
vars<-c("hypertension", "diabetes", "mrs_1") labels_all<-list(rtreat~"Trial treatment", civil~"Cohabitation", diabetes~"Known diabetes", hypertension~"Known hypertension", mrs_1~"One month mRS", mrs_6~"Six months mRS", '[Intercept]'~"Intercept") label_select(labels_all,vars) ## With gtsummary::tbl_summary() #stRoke::talos[vars] |> #gtsummary::tbl_summary(label = label_select(labels_all,vars))
Vector of REDCap metadata headers
data(metadata_names)
data(metadata_names)
Vector of length 18 with REDCap metadata headers:
characterstrings
project-redcap(dot)org (currently the certificate is broken)
MFI domain score calculator
mfi_domains( ds, reverse = TRUE, reverse.vars = c(2, 5, 9, 10, 13, 14, 16, 17, 18, 19) )
mfi_domains( ds, reverse = TRUE, reverse.vars = c(2, 5, 9, 10, 13, 14, 16, 17, 18, 19) )
ds |
data set of MFI scores, 20 columns |
reverse |
reverse scoring |
reverse.vars |
variables/columns to reverse |
tibble of domain scores
mfi_mess <- data.frame(matrix( sample(c(" 1. ", "2. -A", "3.", " 4 ", "5.", NA),200,replace=TRUE),ncol=20)) mfi_mess |> mfi_domains()
mfi_mess <- data.frame(matrix( sample(c(" 1. ", "2. -A", "3.", " 4 ", "5.", NA),200,replace=TRUE),ncol=20)) mfi_mess |> mfi_domains()
Reverses relevant MFI subscores
multi_rev(d, var)
multi_rev(d, var)
d |
data frame or tibble |
var |
numeric vector of indices of columns to reverse |
data.frame or tibble depending on input
# rep_len(sample(1:5),length.out = 100) |> matrix(ncol=10) |> multi_rev(2:4)
# rep_len(sample(1:5),length.out = 100) |> matrix(ncol=10) |> multi_rev(2:4)
Splits in n chunks
n_chunks(d, n, ...)
n_chunks(d, n, ...)
d |
data |
n |
number of chunks |
... |
arguments passed to internal |
List of chunks
lengths(n_chunks(d=seq_len(100),n=7,even=TRUE)) lengths(n_chunks(d=seq_len(100),n=7,even=FALSE))
lengths(n_chunks(d=seq_len(100),n=7,even=TRUE)) lengths(n_chunks(d=seq_len(100),n=7,even=FALSE))
Contains non-identifiable organic trial data. Sample data labels are in Danish.
data(pase)
data(pase)
A data frame with 200 rows and 21 variables:
item 01, factor
item 01b, factor
item 02, factor
item 02a, factor
item 03, factor
item 03b, factor
item 04, factor
item 04b, factor
item 05, factor
item 05b, factor
item 06, factor
item 06b, factor
item 07, factor
item 08, factor
item 09a, factor
item 09b, factor
item 09c, factor
item 09d, factor
item 10, factor
item 10a, numeric
item 10b, factor
Calculates PASE score from raw questionnaire data.
pase_calc(ds, adjust_work = FALSE, consider.missing = c("Not available"))
pase_calc(ds, adjust_work = FALSE, consider.missing = c("Not available"))
ds |
data set |
adjust_work |
flag to set whether to include 10b type 1. |
consider.missing |
character vector of values considered missing. Default is TRUE. |
Labelling should be as defined by the questionnaire. 02-06 should start with 0:3, 02a-06b should start with 1:4.
The score calculation manual available for the PASE questionnaire, all types
of work should be included. According to the article by
Washburn RA. et al (1999) sitting work is not included in the item 10 score.
This differentiation is added with the option to set adjust_work
to
exclude item 10b category 1 work (set TRUE
).
Output includes sub scores as well as sums, but also to columns assessing data
quality and completeness. If any field has not been filled, score_incompletes
will return TRUE
. If all measures are missing score_missings
is TRUE
.
If adjust_work==TRUE
, 10b has to be filled, or score_incompletes
will be
set TRUE
.
data.frame
summary(pase_calc(stRoke::pase)[,13]) str(pase_calc(stRoke::pase))
summary(pase_calc(stRoke::pase)[,13]) str(pase_calc(stRoke::pase))
Prints win_prob results
## S3 method for class 'win_Prob' print(x, ...)
## S3 method for class 'win_Prob' print(x, ...)
x |
win_prob results. |
... |
ignored for now |
Prints win_prob statistics.
Using base/stats functions cut() and quantile().
quantile_cut( x, groups, y = NULL, na.rm = TRUE, group.names = NULL, ordered.f = FALSE, inc.outs = FALSE, detail.list = FALSE )
quantile_cut( x, groups, y = NULL, na.rm = TRUE, group.names = NULL, ordered.f = FALSE, inc.outs = FALSE, detail.list = FALSE )
x |
Variable to cut. |
groups |
Number of groups. |
y |
alternative vector to draw quantile cuts from. Limits has to be within x. Default is NULL. |
na.rm |
Remove NA's. Default is TRUE. |
group.names |
Names of groups to split to. Default is NULL, giving intervals as names. |
ordered.f |
Set resulting vector as ordered. Default is FALSE. |
inc.outs |
Flag to include min(x) and max(x) as borders in case of y!=NULL. |
detail.list |
flag to include details or not |
vector or list with vector and details (length 2)
aa <- as.numeric(sample(1:1000,2000,replace = TRUE)) x <- 1:450 y <- 6:750 summary(quantile_cut(aa,groups=4,detail.list=FALSE)) ## Cuts quartiles
aa <- as.numeric(sample(1:1000,2000,replace = TRUE)) x <- 1:450 y <- 6:750 summary(quantile_cut(aa,groups=4,detail.list=FALSE)) ## Cuts quartiles
Contains non-identifiable organic trial data from a five-dimensional cognitive test.
data(score)
data(score)
A data frame with 20 rows and 26 variables:
id
event
domain a index score
domain b index score
domain c index score
domain d index score
domain e index score
total index score
domain a lower ci
domain b lower ci
domain c lower ci
domain d lower ci
domain e lower ci
total lower ci
domain a upper ci
domain b upper ci
domain c upper ci
domain d upper ci
domain e upper ci
total upper ci
domain a percentile
domain b percentile
domain c percentile
domain d percentile
domain e percentile
total percentile
Sources specific lines from a file
source_lines(file, lines, ...)
source_lines(file, lines, ...)
file |
A character string giving the path to the file to be sourced. |
lines |
A numeric vector of line numbers to be sourced. |
... |
Additional arguments to be passed to |
The result of source
.
This function is borrowed from a gist by christophergandrud.
test_file <- tempfile(fileext = ".R") writeLines(c("# Line 1", "2+2", "# Line 3"), test_file) source_lines(test_file, 1:2, echo=TRUE)
test_file <- tempfile(fileext = ".R") writeLines(c("# Line 1", "2+2", "# Line 3"), test_file) source_lines(test_file, 1:2, echo=TRUE)
DEPRECATION: moved to agdamsbo/project.aid
str_extract(d, pattern)
str_extract(d, pattern)
d |
vector of character strings |
pattern |
regex pattern to match |
Use base::strsplit to
vector of character strings
ls <- do.call(c,lapply(sample(4:8,20,TRUE),function(i){ paste(sample(letters,i,TRUE),collapse = "")})) ds <- do.call(c,lapply(1:20,function(i){ paste(sample(ls,1),i,sample(ls,1),"23",sep = "_")})) str_extract(ds,"([0-9]+)")
ls <- do.call(c,lapply(sample(4:8,20,TRUE),function(i){ paste(sample(letters,i,TRUE),collapse = "")})) ds <- do.call(c,lapply(1:20,function(i){ paste(sample(ls,1),i,sample(ls,1),"23",sep = "_")})) str_extract(ds,"([0-9]+)")
Contains of non-identifiable subset of data from the TALOS trial.
data(talos)
data(talos)
A data frame with 200 rows and 6 variables:
Randomisation
Modified Rankin scale score at follow-up
Modified Rankin scale score at end of study
Known hypertension
Known diabetes
Cohabitation status
doi:10.1161/STROKEAHA.117.020067
Calculates the probability of winning (winP). In the referenced article Zou et al (2022) proposes a method for calculating probability of winning with a confidence interval an p-value testing.
win_prob( data, response = NULL, group = NULL, alpha = 0.05, beta = 0.2, group.ratio = 1, sample.size = FALSE, print.tables = FALSE, dec = 3 )
win_prob( data, response = NULL, group = NULL, alpha = 0.05, beta = 0.2, group.ratio = 1, sample.size = FALSE, print.tables = FALSE, dec = 3 )
data |
A data frame containing the response and group variable. |
response |
The name of the response variable. Takes first column if empty. |
group |
The name of the group variable. Takes second column if empty. |
alpha |
The alpha level for the hypothesis test. Default is 0.05. |
beta |
The beta level for the sample size calculation. Default is 0.2. |
group.ratio |
The ratio of group sizes. Default is 1. |
sample.size |
Flag to include sample size calculation. Default is FALSE. |
print.tables |
Flag to print cumulative tables. Default is FALSE. |
dec |
Numeric for decimals to print. Default is 3. |
A list containing the win_prob statistics.
doi:10.1161/STROKEAHA.121.037744
win_prob(data=stRoke::talos,response="mrs_6",group="rtreat")
win_prob(data=stRoke::talos,response="mrs_6",group="rtreat")
This function creates an ical file based on a data frame with mixed events.
Export as .ics file using calendar::ic_write()
.
write_ical( df, date = "date", date.end = NA, title = "title", time.start = "start", time.end = "end", place = NA, place.def = NA, time.def = "10:00:00", time.dur = 60, descr = NA, link = NA, t.zone = "CET" )
write_ical( df, date = "date", date.end = NA, title = "title", time.start = "start", time.end = "end", place = NA, place.def = NA, time.def = "10:00:00", time.dur = 60, descr = NA, link = NA, t.zone = "CET" )
df |
A data frame with the calendar data |
date |
The name of the event date column in the data frame |
date.end |
The name of the end date column in the data frame |
title |
The name of the title column in the data frame |
time.start |
The name of the start time column in the data frame |
time.end |
The name of the end time column in the data frame |
place |
The name of the place column in the data frame |
place.def |
Default location to use when place is NA |
time.def |
Default start time to use when time.start is NA |
time.dur |
Default duration of the event in minutes, if time.end is NA |
descr |
Name of description/notes column if any. |
link |
Name of link column, if any. |
t.zone |
A character string of time zone for events. The string must be a time zone that is recognized by the user's OS. |
ical object
calendar package icalendar standard webpage
df <- data.frame( date = c("2020-02-10", "2020-02-11"), date.end = c("2020-02-13",NA), title = c("Conference", "Lunch"), start = c("12:00:00", NA), time.end = c("13:00:00", NA), note = c("Hi there","Remember to come"), link = c("https://icalendar.org","https://agdamsbo.github.io/stRoke/") ) write_ical( df, date = "date", date.end = "date.end", title = "title", time.start = "start", time.end = "time.end", place.def = "Conference Room", descr = "note", link = "link" )
df <- data.frame( date = c("2020-02-10", "2020-02-11"), date.end = c("2020-02-13",NA), title = c("Conference", "Lunch"), start = c("12:00:00", NA), time.end = c("13:00:00", NA), note = c("Hi there","Remember to come"), link = c("https://icalendar.org","https://agdamsbo.github.io/stRoke/") ) write_ical( df, date = "date", date.end = "date.end", title = "title", time.start = "start", time.end = "time.end", place.def = "Conference Room", descr = "note", link = "link" )