inst/tinytest/test-errors-input.R

library("anticlust")

# exported function cannot be used with NA"
data(iris)
iris[1, 1] <- NA
expect_error(
  anticlustering(iris[, -5], K = 3)
)
expect_error(
  matching(iris[, -5], p = 3)
)
expect_error(
  balanced_clustering(iris[, -5], p = 3)
)

# exported functions cannot be used with non-numeric input"
data(iris)
expect_error(
  anticlustering(iris, K = 3)
)
expect_error(
  matching(iris, p = 3)
)
expect_error(
  balanced_clustering(iris, p = 3)
)

Try the anticlust package in your browser

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

anticlust documentation built on April 4, 2025, 1:03 a.m.