hutilscpp (version 0.1.0)

pmaxC: Parallel maximum/minimum

Description

Faster pmax() and pmin().

Usage

pmaxC(x, a, in_place = FALSE)

pmax0(x, in_place = FALSE)

pmaxV(x, y, in_place = FALSE)

pmax3(x, y, z, in_place = FALSE)

Arguments

x

A numeric vector.

a

A single numeric value.

in_place

(logical, default: FALSE) Should x be modified in-place.

y, z

Other numeric vectors the same length as x

Value

The parallel maximum/minimum of the input values. pmax0(x) is shorthand for pmaxC(x, 0), i.e. convert negative values in x to 0.

Examples

Run this code
# NOT RUN {
pmaxC(-5:5, 2)

# }

Run the code above in your browser using DataCamp Workspace