ranks: Reversed Rankings

Description Usage Arguments Details Value Examples

View source: R/ranks.R

Description

Method for giving the reversed rankings of the numerical values of a vector or VarImp object.

Usage

1
2
3
4
5
6
 
   ranks(x, note = TRUE, ...)
## Default S3 method:
ranks(x, note = TRUE, ...)
## S3 method for class 'VarImp'
ranks(x, note = TRUE, ...)

Arguments

x

an object to be reverse ranked.

note

a logical specifying whether the (reversed) rankings should be printed instead of the importance values.

...

additional arguments to be passed to rank.

Details

The ranks function is nothing more than (length(x) - rank(x, ...) + 1L). But it also works for objects of class VarImp.

Value

A vector containing the reversed rankings.

Examples

1
2
3
4
5
6
  ## High Jump data
  HighJumps <- c(Anna = 1.45, Betty = 1.53, Cara = 1.37, Debby = 1.61, 
                 Emma = 1.29, Hanna = 1.44, Juno = 1.71)
  HighJumps
  ## ranking of high jump data
  ranks(HighJumps)

Example output

 Anna Betty  Cara Debby  Emma Hanna  Juno 
 1.45  1.53  1.37  1.61  1.29  1.44  1.71 
Reversed ranking: 1 denotes the highest value. 
  Anna Betty  Cara Debby  Emma Hanna  Juno 
    4     3     6     2     7     5     1 

permimp documentation built on Sept. 14, 2021, 1:07 a.m.