tests/testthat/test-stIHC.R

test_that("stIHC runs on example data and returns valid output", {

  rds_path <- system.file("extdata", "spatial_data.rds", package = "stIHC")
  expect_true(file.exists(rds_path))

  example_data <- readRDS(rds_path)
  expect_true(is.list(example_data))

  example_data <- readRDS(rds_path)
  res = stIHC(example_data) #Run stIHC
  expect_type(res, "list")
  expect_true(all(
    c("label", "clusters", "mean_clusters_mat") %in% names(res)
  ))
})

Try the stIHC package in your browser

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

stIHC documentation built on Oct. 21, 2026, 5:14 p.m.