pmaxC(
x,
a,
in_place = FALSE,
keep_nas = FALSE,
dbl_ok = NA,
nThread = getOption("hutilscpp.nThread", 1L)
)pminC(
x,
a,
in_place = FALSE,
keep_nas = FALSE,
dbl_ok = NA,
nThread = getOption("hutilscpp.nThread", 1L)
)
pmax0(
x,
in_place = FALSE,
sorted = FALSE,
keep_nas = FALSE,
nThread = getOption("hutilscpp.nThread", 1L)
)
pmin0(
x,
in_place = FALSE,
sorted = FALSE,
keep_nas = FALSE,
nThread = getOption("hutilscpp.nThread", 1L)
)
pmaxV(
x,
y,
in_place = FALSE,
dbl_ok = TRUE,
nThread = getOption("hutilscpp.nThread", 1L)
)
pminV(
x,
y,
in_place = FALSE,
dbl_ok = TRUE,
nThread = getOption("hutilscpp.nThread", 1L)
)
pmax3(x, y, z, in_place = FALSE)
pmin3(x, y, z, in_place = FALSE)
Versions of pmax and pmin, designed for performance.
When in_place = TRUE, the values of x are modified in-place.
For advanced users only.
The differences are:
pmaxC(x, a) and pminC(x, a)Both x and a must be numeric and
a must be length-one.
numeric(n)A numeric vector.
TRUE | FALSE, default: FALSEShould x be modified in-place? For advanced use only.
TRUE | FALSE, default: FALSEShould NAs values be
preserved? By default, FALSE, so the behaviour of the function is
dependent on the representation of NAs at the C++ level.
logical(1), default: NAIs it acceptable to return
a non-integer vector if x is integer?
This argument will have effect a is both double and cannot be coerced to
integer:
If NA, the default, a message is emitted whenever a double vector
needs to be returned.
If FALSE, an error is returned.
If TRUE, neither an error nor a message is returned.
integer(1)The number of threads to use. Combining nThread > 1
and in_place = TRUE is not supported.
TRUE | FALSE, default: FALSEIs x known to be sorted?
If TRUE, x is assumed to be sorted. Thus the
first zero determines whether the position at which zeroes start or end.
pmaxC(-5:5, 2)
pmaxC(1:4, 5.5)
pmaxC(1:4, 5.5, dbl_ok = TRUE)
# pmaxC(1:4, 5.5, dbl_ok = FALSE) # error
Run the code above in your browser using DataLab