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 June 25, 2024, 1:15 a.m.