irank_against | R Documentation |
The method irank
compares ranks using the same vector as reference.
This method returns ranks, that values from x
would assume if (individually)
inserted into v
.
irank_against(x, v, omega = 0, increasing = FALSE, na.rm = FALSE)
frank_against(x, v, omega = 0, increasing = FALSE, na.rm = FALSE)
x |
numeric query vector. |
v |
numeric reference vector. |
omega |
numeric value in [0,1], defining how ties in |
increasing |
logical; if |
na.rm |
logical; if |
This function implements all possible definitions of ranks of the values in x
. Different definitions of the ranks are chosen through combinations of the two arguments
omega
and increasing
. Suppose x
is of length p
. If increasing=TRUE
, then the largest value in x
receives the rank p
and the smallest
the rank 1
. If increasing=FALSE
, then the largest value in x
receives the rank 1
and the smallest
the rank p
.
The value of omega
indicates how ties are handled. If there are no ties in x
, then the value of omega
does not affect the ranks and the only choice to be made is whether
the ranks should be increasing or decreasing with the values in x
. When there are ties in x
, however, then there are infinitely
many possible ranks that can be assigned to a tied value.
When increasing=TRUE
, then omega=0
leads to the smallest possible and omega=1
to the largest possible rank of a tied value. Values of omega
between
0 and 1 lead to values of the rank between the largest and smallest.
Integer vector of the same length as x
containing the ranks.
frank_against()
: Compute integer ranks in another reference vector
irank_against(1:10, c(4,4,4,3,1,10,7,7))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.