VbetterMin: Vector Better Min

Description Usage Arguments Value Examples

View source: R/VbetterMin.R

Description

Find the element by element min of two vectors

Usage

1
VbetterMin(x, y)

Arguments

x

A numeric vector

y

A numeric vector of the same length as x or of length 1 (if y has length 1, it will be repeated to the length of x)

Value

A numeric vector where each position is the smallest 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.

Examples

 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)
VbetterMin(ex1, ex2)
VbetterMin(ex1, ex3)
VbetterMin(ex1, ex4)
VbetterMin(ex2, ex3)
VbetterMin(ex2, ex4)
VbetterMin(ex3, ex4)
VbetterMin(ex1, 7)
VbetterMin(ex3, 5)
VbetterMin(ex3, NA)

debarros/dbTools documentation built on Sept. 18, 2020, 10:51 a.m.