diff --git a/R/DEqual.R b/R/DEqual.R index 7ce43b6..88f33f2 100644 --- a/R/DEqual.R +++ b/R/DEqual.R @@ -45,7 +45,7 @@ DEqual <- function(DE) { # stopifnot(!is.null(rownames(DE))) # Check if input is a dataframe - if (!is.data.frame(DE)) { stop("Error: The input is not a dataframe") } + if (!is.data.frame(DE)) { stop("Error: The input to DEqual is not a dataframe.") } # Check if 't' is in the column names of DE if (!("t" %in% colnames(DE))) { diff --git a/tests/testthat/test-DEqual.R b/tests/testthat/test-DEqual.R index d7f8cd7..04f4c2c 100644 --- a/tests/testthat/test-DEqual.R +++ b/tests/testthat/test-DEqual.R @@ -17,6 +17,12 @@ test_that("Input to DEqual is a dataframe", { # Test if the input to DEqual is a dataframe expect_true(is.data.frame(random_de), "The input to DEqual is not a dataframe.") }) + +# Test if DEqual throws an error when input is not a dataframe +test_that("DEqual throws an error for non-dataframe input", { + # Test if DEqual throws an error when input is not a dataframe + expect_error(DEqual(covComb_tx_deg), "Error: The input to DEqual is not a dataframe.") +}) # Test that the output is a ggplot object test_that("output is a ggplot", {