inst/tinytest/test-standardize.R

library("anticlust")

# standardize argument only works for intended input
expect_error(
  anticlustering(
    rnorm(10),
    K = 2,
    standardize = 123
  )
)

expect_error(
  anticlustering(
    rnorm(10),
    K = 2,
    standardize = "foof"
  )
)

expect_error(
  anticlustering(
    rnorm(10),
    K = 2,
    standardize = c(TRUE, FALSE)
  )
)

expect_error(
  anticlustering(
    rnorm(10),
    K = 2,
    standardize = NA
  )
)

expect_true(length(
  anticlustering(
    rnorm(10),
    K = 2,
    standardize = TRUE
  )) == 10)

expect_true(length(
  anticlustering(
    rnorm(10),
    K = 2,
    standardize = FALSE
  )) == 10)
m-Py/anticlust documentation built on April 13, 2025, 11:17 p.m.