R/cseq.R

Defines functions cseq

Documented in cseq

#' A non-standard (complex) sequence generator
#' 
#' @param from A numeric of start of the complex sequence.
#' @param to A numeric of end of the complex sequence.
#' @param by A numeric vector describing the sequence of number that are added to the last element of the complex sequence in the order from left to right.
#' @return A numeric vector of complex sequence.
#' @author Alexander Kheirallah ([email protected])
#' @export


cseq <- function(from, to, by){
  times <- (to-from) %/% sum(by)
  x <- cumsum(c(from, rep(by, times+1)))
  x[x<=to]
}
msxakk89/dat documentation built on March 25, 2020, 3:18 p.m.