tests/testthat/helpers/creators.R

imperfect_alternation <- function(unq_vals, n_tail = 6L, ...) {
  x <- rep_len(unq_vals, ...)
  tail_idxs_x <- tail(seq_along(x), n = n_tail)
  x[tail_idxs_x] <- x[c(tail_idxs_x[-1],
                        tail_idxs_x[1])]
  return(x)
}

Try the projpred package in your browser

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

projpred documentation built on Nov. 5, 2025, 5:12 p.m.