| tf_order | R Documentation |
tf vectorsThese methods use tf_depth() to rank, order, and sort functional data. By
default they use the modified hypograph index ("MHI") which provides an
up-down ordering (lowest to highest). You can also use any of the other depth
methods available via tf_depth(), or supply a custom depth function.
rank(
x,
na.last = TRUE,
ties.method = c("average", "first", "last", "random", "max", "min"),
...
)
## Default S3 method:
rank(
x,
na.last = TRUE,
ties.method = c("average", "first", "last", "random", "max", "min"),
...
)
## S3 method for class 'tf'
rank(
x,
na.last = TRUE,
ties.method = c("average", "first", "last", "random", "max", "min"),
depth = "MHI",
...
)
## S3 method for class 'tf'
xtfrm(x)
## S3 method for class 'tf'
sort(x, decreasing = FALSE, na.last = NA, depth = "MHI", ...)
x |
a |
na.last |
for handling of |
ties.method |
a character string for handling ties; see |
... |
passed to |
depth |
the depth function to use for ranking. One of the depths
available via |
decreasing |
logical. Should the sort be decreasing? |
rank assigns ranks based on depth values: lower depth values get lower
ranks. For "MHI" this gives an ordering from lowest to highest function.
For centrality-based depths ("MBD", "FM", "FSD", "RPD"), the most
extreme function gets rank 1 and the most central gets the highest rank.
order returns the permutation which rearranges x into ascending
order according to depth.
sort.tf returns the sorted tf vector.
xtfrm.tf returns a numeric vector of MHI depth values, enabling
base::order and base::rank to work on tf vectors.
rank: a numeric vector of ranks.
order: an integer vector of indices.
sort.tf: a sorted tf vector.
xtfrm.tf: a numeric vector of depth values.
tf_depth(), min.tf(), max.tf()
Other tidyfun ordering and ranking functions:
tf_depth(),
tf_minmax
x <- tf_rgp(5) + 1:5
rank(x)
order(x)
sort(x)
# use a centrality-based depth instead:
rank(x, depth = "MBD")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.