it("computes minimum values correctly with grouping by species", {
Species = factor(c("setosa", "versicolor", "virginica"), levels = c("setosa", "versicolor", "virginica")),
expect_equal(min_values, expected_min, info = "Computed min should match expected min")

"computes minimum values correctly with grouping by species"
"Computed min should match expected min"

dt.min.numerics functionality: computes minimum values correctly with grouping by species

Error in `dt.calculate(dt.name = dt.name, the.functions = "remove.erroneous.characters", 
    the.variables = the.variables, the.filter = the.filter, grouping.variables = NULL, 
    sortby.group = TRUE, other.params = other.params, table.format = "wide", 
    add.function.name = FALSE, individual.variables = TRUE, output.as.table = TRUE, 
    return.as = return.as, envir = envir)`: Error:  the.functions must be specified with functions that are loaded.  Make sure to call library() for the required packages.

# Assign iris_dt to the global environment to ensure visibility
assign("iris_dt", iris_dt, envir = globalenv())
it("executes without errors and returns a data.table", {
result <- dt.remove.erroneous.characters(dt.name = "iris_dt", threshold.for.numeric = 0.8)
expect_true(is.data.table(result), "The result should be a data.table")
# Cleanup: Remove iris_dt from the global environment after testing

"executes without errors and returns a data.table"

Functionality of dt.remove.erroneous.characters: executes without errors and returns a data.table

Error in `dt.calculate(dt.name = dt.name, the.variables = the.variables, 
    the.functions = "round.numerics", the.filter = the.filter, 
    grouping.variables = grouping.variables, sortby.group = sortby.group, 
    other.params = other.params, table.format = "wide", add.function.name = add.function.name, 
    return.as = return.as, envir = envir, ...)`: Error:  the.functions must be specified with functions that are loaded.  Make sure to call library() for the required packages.

# Preparing the mock data table 'grouped.means' similar to what dt.mean.numerics would generate
Species = c("setosa", "versicolor", "virginica"),
# Ensure the data table is available in the environment
assign("grouped.means", grouped.means, envir = globalenv())
it("correctly rounds the numeric values to specified digits", {
rounded_values <- dt.round.numerics(dt.name = "grouped.means", digits = 2)
expect_equal(rounded_values, expected_values, info = "The rounded values should match the expected results")