R/fabs.R

Defines functions fabs

Documented in fabs

#' Absolute
#'
#' Computes the absolute value of `x`.
#' Used in TMB as replacement for `abs()` which is seemingly ambiguous.
#'
#' @details A wrapper on [`abs`]`()`.
#'
#' @param x An existing R object.
#' @family translations
#' @export
#' @examples
#' fabs(c(0, -1, 2))
fabs <- function(x) {
  abs(x)
}

Try the extras package in your browser

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

extras documentation built on Aug. 5, 2021, 9:07 a.m.