Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ranktransform

(Signed) rank transformation


Description

Transform numeric values with the integers of their rank (i.e., 1st smallest, 2nd smallest, 3rd smallest, etc.). Setting the sign argument to TRUE will give you signed ranks, where the ranking is done according to absolute size but where the sign is preserved (i.e., 2, 1, -3, 4).

Usage

ranktransform(x, ...)

## S3 method for class 'numeric'
ranktransform(x, sign = FALSE, method = "average", verbose = TRUE, ...)

## S3 method for class 'grouped_df'
ranktransform(
  x,
  select = NULL,
  exclude = NULL,
  sign = FALSE,
  method = "average",
  ...
)

## S3 method for class 'data.frame'
ranktransform(
  x,
  select = NULL,
  exclude = NULL,
  sign = FALSE,
  method = "average",
  ...
)

Arguments

x

Object.

...

Arguments passed to or from other methods.

sign

Logical, if TRUE, return signed ranks.

method

Treatment of ties. Can be one of "average" (default), "first", "last", "random", "max" or "min". See rank() for details.

verbose

Toggle warnings and messages on or off.

select

Character vector of column names. If NULL (the default), all variables will be selected.

exclude

Character vector of column names to be excluded from selection.

Value

A rank-transformed object.

See Also

Other transform utilities: change_scale(), normalize(), standardize()

Examples

ranktransform(c(0, 1, 5, -5, -2))
ranktransform(c(0, 1, 5, -5, -2), sign = TRUE)

head(ranktransform(trees))

effectsize

Indices of Effect Size and Standardized Parameters

v0.4.4-1
GPL-3
Authors
Mattan S. Ben-Shachar [aut, cre] (<https://orcid.org/0000-0002-4287-4801>), Dominique Makowski [aut] (<https://orcid.org/0000-0001-5375-9967>), Daniel Lüdecke [aut] (<https://orcid.org/0000-0002-8895-3206>), Indrajeet Patil [ctb] (<https://orcid.org/0000-0003-1995-6531>, @patilindrajeets), Ken Kelley [ctb], David Stanley [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.