Description Usage Arguments Value See Also Examples
sort
a vector but not very well. For a vector, x
,
n
elements will be randomly selected, and their positions will
remain unchanged as all other elements are sorted.
1 | kinda_sort(x, n, decreasing = FALSE, indices)
|
x |
a vector |
n |
number of elements of x to remove from sorting (the default is
approximately 10% of |
decreasing |
logical; if |
indices |
a vector of indices specifying which elemnts of |
x
sorted approximately (length(x) - n)/length(x)*100
percent.
1 2 3 4 5 6 7 8 9 | set.seed(1)
(x <- sample(1:10))
# [1] 3 4 5 7 2 8 9 6 10 1
kinda_sort(x)
# [1] 1 2 5 3 4 6 7 8 9 10
kinda_sort(x, indices = 2:5)
# [1] 1 4 5 7 2 3 6 8 9 10
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.