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)

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.