Open francisbarton opened 11 months ago
I agree the logic for this flow can be improved, and it's one of the reasons v0.2.0 is a breaking change - it requires the additional sheet on the excel input. The step to confirm whether data is present may need revising too.
The current version is a trade-off between functionality and code complexity but it would be great to find a cleaner way.
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.