This PR adds additional tests to make sure that all exported functions that accept a data.table also work with a data.frame. I simply went through a list of the functions and added tests.
I got the list of functions to check as such (thanks, GPT):
exported_functions <- ls("package:scoringutils")
functions_with_data_arg <- character(0)
for (func_name in exported_functions) {
func_args <- suppressWarnings(formals(get(func_name)))
if (!is.null(names(func_args)) && names(func_args)[1] == "data") {
functions_with_data_arg <- c(functions_with_data_arg, func_name)
}
}
functions_with_data_arg
Checklist
[x] My PR is based on a package issue and I have explicitly linked it.
[x] I have included the target issue or issues in the PR title as follows: issue-number: PR title
[x] I have tested my changes locally.
[x] I have added or updated unit tests where necessary.
[x] I have updated the documentation if required.
[x] I have built the package locally and run rebuilt docs using roxygen2.
[x] My code follows the established coding standards and I have run lintr::lint_package() to check for style issues introduced by my changes.
[ ] I have added a news item linked to this PR.
[ ] I have reviewed CI checks for this PR and addressed them as far as I am able.
Description
This PR closes #438.
This PR adds additional tests to make sure that all exported functions that accept a
data.table
also work with adata.frame
. I simply went through a list of the functions and added tests.I got the list of functions to check as such (thanks, GPT):
Checklist
lintr::lint_package()
to check for style issues introduced by my changes.