`reorder`

is a generic function. The `"default"`

method
treats its first argument as a categorical variable, and reorders its
levels based on the values of a second variable, usually numeric.

1 2 3 4 5 |

`x` |
an atomic vector, usually a |

`X` |
a vector of the same length as |

`FUN` |
a |

`...` |
optional: extra arguments supplied to |

`order` |
logical, whether return value will be an ordered factor rather than a factor. |

This, as `relevel()`

, is a special case of simply calling
`factor(x, levels = levels(x)[....])`

.

A factor or an ordered factor (depending on the value of
`order`

), with the order of the levels determined by
`FUN`

applied to `X`

grouped by `x`

. The
levels are ordered such that the values returned by `FUN`

are in increasing order. Empty levels will be dropped.

Additionally, the values of `FUN`

applied to the subsets of
`X`

(in the original order of the levels of `x`

) is returned
as the `"scores"`

attribute.

Deepayan Sarkar [email protected]

`reorder.dendrogram`

, `levels`

,
`relevel`

.

1 2 3 4 5 6 7 |

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