median_index {rearrr} | R Documentation |
Find index of interest for each vector
Description
Applies function to the indices of each vector
in `...`
.
These functions were created with create_n_fn()
.
Usage
median_index(..., negate = FALSE, round_fn = round)
quantile_index(..., prob, type = 7, negate = FALSE, round_fn = round)
Arguments
... |
Numeric |
negate |
Whether to negate the result. I.e. to multiply it with |
round_fn |
Function for rounding output. Rounding is done prior to negation. |
prob |
Probability in |
type |
Quantile algorithm to use. See |
Value
numeric vector
with one element per supplied vector.
Author(s)
Ludvig Renbo Olsen, r-pkgs@ludvigolsen.dk
See Also
Other n functions:
create_n_fn()
Examples
# Attach packages
library(rearrr)
# Set seed
set.seed(1)
# Create three vectors
x <- runif(10)
y <- runif(15)
z <- runif(20)
median_index(x, y, z)
quantile_index(x, y, z, prob = 0.2)
# Negate result
median_index(x, y, z, negate = TRUE)
[Package rearrr version 0.3.4 Index]