R/elementshift.R

Defines functions elementshift

elementshift <-
function(x, dx) {
  if (dx<0) { dx<-length(x)-(abs(dx)%%length(x)) }
  return=(c(x[-(dx%%length(x)):0],x[1:(dx%%length(x))]))
}
AngusWright/helpRfuncs documentation built on Nov. 17, 2024, 4:37 a.m.