Description Usage Arguments Details Value Note Author(s) References Examples

A utility that returns a list with the components equivalent to sort(x), order(x), rank(x, ties.method = "first").

1 | ```
sortrank(x)
``` |

`x` |
vector compatible with sort(x) |

This utility exists to save a little time on large vectors when two or all three of the sort(), order(), rank() results are required. In case of ties, the ranks component matches `rank(x, ties.method = "first")`

.

A list with components

`x` |
the sorted input vector x |

`ix` |
the permutation = order(x) which rearranges x into ascending order |

`r` |
the ranks of x |

This function was benchmarked faster than the combined calls to `sort`

and `rank`

.

Maria L. Rizzo mrizzo @ bgsu.edu

See `sort`

.

1 |

```
$x
[1] -0.44382364 -0.18541718 0.08489297 0.30150687 1.04367715
$ix
[1] 2 5 4 1 3
$r
[1] 4 1 5 3 2
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.