R/kmeans-aux.R

prepare_k <- function(k) {
  k <- sort.int(unique.default(must(as.integer(k))))
  if (length(k) < 1L || anyNA(k) || any(k < 1L))
    stop("'k' must contain positive numbers throughout")
  names(k) <- k
  k
}

Try the opm package in your browser

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

opm documentation built on May 2, 2019, 6:08 p.m.