Description Usage Arguments Value Examples
Find the element by element max of two vectors
1 | VbetterMax(x, y)
|
x |
A numeric vector |
y |
A numeric vector of the same length as |
A numeric vector where each position is the largest value stored in those positions of the input vectors. If both input vectors have NA for a particular position, that position in the output will also contain NA.
1 2 3 4 5 6 7 8 9 10 11 12 13 | ex1 = 6:10
ex2 = (1:5)*3
ex3 = c(1, 10, NA, 6, 2)
ex4 = c(NA, NA, NA, NA, 5)
VbetterMax(ex1, ex2)
VbetterMax(ex1, ex3)
VbetterMax(ex1, ex4)
VbetterMax(ex2, ex3)
VbetterMax(ex2, ex4)
VbetterMax(ex3, ex4)
VbetterMax(ex1, 7)
VbetterMax(ex3, 5)
VbetterMax(ex3, NA)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.