R/rev.R

Defines functions hutilscpp_rev

hutilscpp_rev <- function(x) {
  if (!length(x)) {
    return(x)
  }
  # to avoid slowness on certain altrep vectors
  if (is_altrep(x)) {
    return(seq.int(x[length(x)], x[1]))
  }
  x[length(x):1L]
}

Try the hutilscpp package in your browser

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

hutilscpp documentation built on Oct. 11, 2023, 9:06 a.m.