abs_diff {hutilscpp} | R Documentation |
Absolute difference
Description
Equivalent to abs(x - y)
but aims to be faster by
avoiding allocations.
Usage
abs_diff(x, y, nThread = getOption("hutilscpp.nThread", 1L), option = 1L)
max_abs_diff(x, y, nThread = getOption("hutilscpp.nThread", 1L))
Arguments
x , y |
Atomic, numeric, equilength vectors. |
nThread |
Number of threads to use. |
option |
An integer, provides backwards-compatible method to change results.
|
Examples
x <- sample(10)
y <- sample(10)
abs_diff(x, y)
max_abs_diff(x, y)
[Package hutilscpp version 0.10.5 Index]