Description Usage Arguments Value Examples
For two sorted numeric vectors a
and b
, determine the sorted union of unique elements.
1 | sorted_union(a, b, tolerance = 0)
|
a |
a sorted vector of numbers. |
b |
a sorted vector of numbers. |
tolerance |
a non-negative number, indicating the tolerance for numerical noise. Specifically, numbers in |
A numeric vector.
1 2 3 4 5 6 7 8 9 10 11 | sorted_union(1:3, 2:4)
# Numerical noise < tolerance has no effect
sorted_union(0, 1e-14)
sorted_union(0, 1e-14, tolerance=1e-12)
sorted_union(c(0, 1e-14), 2, tolerance=1e-12)
# Trivial cases
sorted_union(1:10, c())
sorted_union(c(), 1:10)
sorted_union(c(), c())
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.