R/rangeToSequence.R

Defines functions rangeToSequence

Documented in rangeToSequence

#' Create Sequence from Range
#' 
#' @param x numeric vector with exactly two elements
#' @return integer sequence between \code{x[1]} and \code{x[2]}
#' @export
#' @examples
#' rangeToSequence(c(1, 10))
rangeToSequence <- function(x)
{
  stopifnot(is.numeric(x), length(x) == 2L)
  
  do.call(seq.int, as.list(x))
}
KWB-R/kwb.utils documentation built on April 1, 2024, 7:12 a.m.