Description Usage Arguments Details Examples
Partial sort an lvec
1 2 3 | partial_sort(x, pivots, clone = TRUE)
partial_order(x, pivots)
|
x |
an object of type |
pivots |
a numeric vector with indices at which the vector will be sorted. See details for more information. |
clone |
clone the vector first before sorting; or sort (and therefore modify) the input vector directly. |
After partial sorting the vector values at the pivots are the same as the
vector values of a completely sorted vector. Furthermore, for each pivot
i
all elements x[j]; j < i
are smaller or equal to than
x[i]
and all elements x[j]; j > i
are larger than or equal to
x[i]
.
The speed of this operation should be O(n, k) with n the size of the
lvec
and k the number of pivots.
1 2 3 4 5 6 7 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.