rkindex: Index, based on rank.

Description Usage Arguments Details Value Author(s) Examples

View source: R/rkindex.R

Description

Convert x to an index in 1... maxindex

Usage

1
rkindex(x, maxindex = length(x), pwr = 1, ties.method = "random", id)

Arguments

x

A vector of data to covert.

maxindex

Maximum for result

pwr

See details.

ties.method

passed to rank.

id

A string to be passed as id argument. If missing, an id will be generated from the arguments.

Details

x is transformed to a rank scale, using ties.method. It is then rescaled to [0,1], and (optionally) a power transformation is applied. In visualisation terms, this is a gamma correction. The result is rescaled to 1 ... maxindex.

Value

A vector of rescaled values.

Author(s)

Günther Sawitzki <gsawitzki@users.r-forge.r-project.org>

Examples

1
2
3
4
5
 x <- runif(7)
 x
 str(rkindex(x, maxindex=5))
 str(rkindex(x, maxindex=5, pwr=0.5))
 

sprof documentation built on May 2, 2019, 4:45 p.m.