# Adding a column with missing values for testing
iris$noise <- ifelse(runif(nrow(iris)) > 0.95, NA, runif(nrow(iris)))
it("calculates the proportion of measured values correctly", {
expect_true(is.data.table(measured_values), info = "Should return a data.table")
the.filter = "Sepal.Length > 4 & Sepal.Length < 6",
expect_true(is.data.table(filtered_measured_values), info = "Filtered result should be a data.table")

"calculates the proportion of measured values correctly"
"Filtered result should be a data.table"

dt.mean.measured functionality: calculates the proportion of measured values correctly

dt.mean.measured functionality: applies filters correctly

Error in `dt.calculate(dt.name = dt.name, the.variables = the.variables, 
    the.functions = "mean.missing", the.filter = the.filter, 
    grouping.variables = grouping.variables, sortby.group = sortby.group, 
    table.format = table.format, 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.

iris$noise <- ifelse(runif(nrow(iris)) > 0.98, NA, runif(nrow(iris)))
it("calculates the proportion of missing values correctly", {
expect_true(is.data.table(missing_values), info = "Should return a data.table")
it("applies filters and grouping correctly", {
expect_true(is.data.table(filtered_grouped_missing_values), info = "Filtered and grouped result should be a data.table")

"calculates the proportion of missing values correctly"
"applies filters and grouping correctly"
"Filtered and grouped result should be a data.table"

dt.mean.missing functionality: calculates the proportion of missing values correctly

dt.mean.missing functionality: applies filters and grouping correctly

Error in `dt.calculate(dt.name = dt.name, the.variables = the.variables, 
    the.functions = "mean.numerics", the.filter = the.filter, 
    grouping.variables = grouping.variables, sortby.group = sortby.group, 
    other.params = other.params, table.format = table.format, 
    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.