Error in `dt.calculate(dt.name = dt.name, the.variables = the.variables, 
    the.functions = "character.coercion.culprits", the.filter = the.filter, 
    grouping.variables = grouping.variables, grouping.type = grouping.type, 
    add.function.name = add.function.name, other.params = other.params, 
    ...)`: Error:  the.functions must be specified with functions that are loaded.  Make sure to call library() for the required packages.

# Ensure you're using the 3rd edition of testthat
# Define a setup function for your test fixture
iris_dt$SL.1000 <- iris_dt$Sepal.Length * 1000 + rnorm(n = nrow(iris_dt), mean = 0, sd = 25)
assign("iris_dt", iris_dt, envir = globalenv())  # Assign to the global environment
# Start your test file with this setup call
it("returns a data.table with expected columns", {
result <- dt.character.coercion.culprits(dt.name = "iris", threshold.for.numeric = 0.8, the.variables = ".")
it("adjusts output based on the threshold", {
result_low_threshold <- dt.character.coercion.culprits(dt.name = "iris", threshold.for.numeric = 0.1, the.variables = ".")
result_high_threshold <- dt.character.coercion.culprits(dt.name = "iris", threshold.for.numeric = 0.9, the.variables = ".")
it("only processes specified variables", {
result_specific_vars <- dt.character.coercion.culprits(dt.name = "iris", threshold.for.numeric = 0.5, the.variables = c("Sepal.Width", "Petal.Width"))
result_grouping <- dt.character.coercion.culprits(dt.name = "iris", threshold.for.numeric = 0.5, the.variables = ".", grouping.variables = "Species")
it("handles different return types correctly", {
result_code <- dt.character.coercion.culprits(dt.name = "iris", threshold.for.numeric = 0.5, the.variables = ".", return.as = "code")
result_all <- dt.character.coercion.culprits(dt.name = "iris", threshold.for.numeric = 0.5, the.variables = ".", return.as = "all")
expect_true("result" %in% names(result_all) && "code" %in% names(result_all))

"returns a data.table with expected columns"
"handles different return types correctly"