R/truncate_vector.r

Defines functions truncate_vector

Documented in truncate_vector

#' @title truncate_vector
#' @description truncate a vector or scalar to be bounded within a range
#' @family abysmally documented
#' @author  unknown, \email{<unknown>@@dfo-mpo.gc.ca}
#' @export
truncate_vector = function( x, lower=-Inf, upper=Inf ) {
  .Internal( pmin( na.rm=TRUE, .Internal(pmax( na.rm=TRUE, x, lower ) ), upper ) )
}
AtlanticR/bio.utilities documentation built on June 21, 2020, 7:43 p.m.