R/locallyUnique.R

setMethodS3("locallyUnique", "default", function(x, ...) {
  n <- length(x)
  if (n < 2)
    return(x)
  ok <- c(TRUE, (x[-n] != x[-1]))
  x[ok]
})

Try the aroma.core package in your browser

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

aroma.core documentation built on Nov. 16, 2022, 1:07 a.m.