reorder_vector {mlr3misc} | R Documentation |
Reorder Vector According to Second Vector
Description
Returns an integer vector to order vector x
according to vector y
.
Usage
reorder_vector(x, y, na_last = NA)
Arguments
x |
( |
y |
( |
na_last |
(
|
Value
(integer()
).
Examples
# x subset of y
x = c("b", "a", "c", "d")
y = letters
x[reorder_vector(x, y)]
# y subset of x
y = letters[1:3]
x[reorder_vector(x, y)]
x[reorder_vector(x, y, na_last = TRUE)]
x[reorder_vector(x, y, na_last = FALSE)]
[Package mlr3misc version 0.15.1 Index]