ae: Absolute Error

Description Usage Arguments Value Examples

Description

Calculates the absolute difference between x and target.

Usage

1
ae(x, target, na.rm = FALSE)

Arguments

x

numeric vector; the values to check

target

numeric vector; the values to compare against

na.rm

logical; should we remove NA cases?

Value

atomic numeric value; the absolute error

Examples

1
2
3
ae(c(1, 2, 3), c(1, 2, 4))     #> 1
ae(c(1, 2, 3), c(2, 3, 4))     #> 3
ae(c(1, 2, 3), c(-1, -2, -3))  #> 12

max-graham/metrics documentation built on May 5, 2019, 5:53 p.m.