tests/testthat/test-plot_heatmap.R

library(testthat)
library(ggplot2)

test_that("plot_heatmap generates a ggplot object", {
  # Create example data
  data <- matrix(rnorm(100), nrow = 10, ncol = 10)
  rownames(data) <- paste0("Row", 1:10)
  colnames(data) <- paste0("Col", 1:10)

  # Generate the plot
  plot <- plot_heatmap(data)

  # Check that the result is a ggplot object
  expect_s3_class(plot, "gg")
})

Try the MDDC package in your browser

Any scripts or data that you put into this service are public.

MDDC documentation built on April 11, 2025, 5:45 p.m.