Currently this function assumes that the measure data list contains an event list (e_data) element.
e_data <- measure_data |>
purrr::pluck("events")
The processing of this data could be contained within an if clause, so that it only runs if event data is included - it might not be?
[if ("events" %in% names(measure_data))]
check_measure_data() (line 15-) currently only demands "week" and "month" be present but in the above situation it turns out that "events" is effectively mandatory too.
Further down, the check_e_data() function is called, which tests if(is.null(e_data)) stop("The 'events' worksheet is missing from 'measure_data'.") but by this point the function will already have failed if there was no "events" element / sheet.
It should be possible to run a report even if you don't require any event list / t-chart data to be included.
Currently this function assumes that the measure data list contains an event list (
e_data) element.The processing of this data could be contained within an if clause, so that it only runs if event data is included - it might not be?
[
if ("events" %in% names(measure_data))]check_measure_data()(line 15-) currently only demands "week" and "month" be present but in the above situation it turns out that "events" is effectively mandatory too.Further down, the
check_e_data()function is called, which testsif(is.null(e_data)) stop("The 'events' worksheet is missing from 'measure_data'.")but by this point the function will already have failed if there was no "events" element / sheet.It should be possible to run a report even if you don't require any event list / t-chart data to be included.