A generic auxiliary function that produces a numeric vector which
will sort in the same order as `x`

.

1 | ```
xtfrm(x)
``` |

`x` |
an |

This is a special case of ranking, but as a less general function than
`rank`

is more suitable to be made generic. The default
method is similar to ```
rank(x, ties.method = "min",
na.last = "keep")
```

, so `NA`

values are given rank `NA`

and all
tied values are given equal integer rank.

The `factor`

method extracts the codes. The
`Surv`

method sorts first on times and then on
status code(s), finally on `timme2`

if present. Note that with
the conventional status codes this sorts individuals still alive before
deaths.

The default method will unclass the object if
`is.numeric(x)`

is true but otherwise make use of
`==`

and `>`

methods for the class of `x[i]`

(for
integers `i`

), and the `is.na`

method for the class of
`x`

, but might be rather slow when doing so.

This is an internal generic primitive, so S3 or S4 methods can be written for it.

A numeric (usually integer) vector of the same length as `x`

.

`rank`

, `sort`

, `order`

.

What can we improve?

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.

Close