R/broadcast.R

Defines functions broadcast

Documented in broadcast

#' broadcasts a shorter vector-like object into a vector of equal length as a longer vector-like object
#' @param longer longer vector-like object
#' @param shorter shorter vector-like object
#'
#'
broadcast <- function(longer, shorter) {
  return (rep(shorter, ceiling(length(longer) / length(shorter) ) )[1:length(longer)])
}

Try the zipR package in your browser

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

zipR documentation built on May 1, 2019, 7:06 p.m.