Closed edward-burn closed 2 weeks ago
create function:
resultPackageVersion <- function(result) {
- check that it is a summarised result (validateResultArgument with all checks turned to FALSE)
- get settings and report packages and versions used
- if there are multiple versions of a package throw a warning
}
I am a bit unclear on this one. So this function is just checking the summariseResult don't contain different package version? Or we comparing two different summariseResult object? @catalamarti
i guess this will be used after we bind all the summariseResult from different dataPartner? Or we apply this before?
resultPackageVersion <- function(result) {
# initial checks
validateResultArguemnt(result)
# get sets
set <- settings(result) |>
dplyr::select("result_id", "result_type", "package_name", "package_version")
# throw warning if two versions of the same package have been used
pkgToWarn <- set |>
dplyr::group_by(.data$package_name) |>
dplyr::tally() |>
dplyr::filter(.data$n > 1)
# message with the used versions
# fancy print
cli::cli_inform("{xx} different packages used in this {.cls summarised_result}:")
x <- set |>
dplyr::select("package_name", "package_version") |>
dplyr::distinct()
# ....
return(invisible(set))
}
For example, this would allow me to easily check data partners had used the same versions of an analytic package used to generate a result