maxabs {broman}R Documentation

maximum of absolute value

Description

Take the maximum of the absolute values of the input

Usage

maxabs(x, na.rm = FALSE)

Arguments

x

a numeric vector or array

na.rm

a logical indicating whether missing values should be removed.

Value

The maximum of the absolute value of the input

Examples

x <- c(5, -2, 8, -20, 2.3)
maxabs(x)

[Package broman version 0.84 Index]