In R, the pmin()
function is used to obtain the parallel minima of two or more given vectors. In simple words, it returns the minimum of the values of the two or more vectors pair-wise.
pmin(..., na.rm = FALSE)
This function takes the following parameter values:
...
: This represents input vector objects. This parameter is required.na.rm
: This takes a logical value (TRUE
or FALSE
) indicating if the missing values should be removed or not. This parameter is optional.This function returns a vector with the longest of the input vectors representing the pair-wise minima of the input vectors.
# creating vectora <- c(10, 8, 3, 9, 0, 5)b <- c(15, 4, 6, 9, 8, 4)# obtaining the maximum values pairwisepmin(a, b)
a
and b
.