Given a sequence of $n$ non-negative numbers $x=(x_1,\dots,x_n)$,
where $x_i \ge x_j$ for $i \le j$,
the $r_p$-index for $p=\infty$ equals to
$$r_p(x)=\max_{i=1,\dots,n} { \min{i,x_i} }$$
if $n \ge 1$, or $r_\infty(x)=0$ otherwise.
For the definition of the $r_p$-index for $p < \infty$ we refer
to (Gagolewski, Grzegorzewski, 2009).Note that if $x_1,\dots,x_n$ are integers, then
$$r_\infty(x)=H(x),$$ where $H$ is the $h$-index (Hirsch, 2005) and
$$r_1(x)=W(x),$$ where $W$ is the $w$-index (Woeginger, 2008).
If disable.check
is set to FALSE
, then
eventual NA
values are removed from the input vector.
If a non-increasingly sorted vector is given as input (set sorted.dec
to TRUE
)
the value of $r_\infty$ is calculated in log time
(note that it may be determined in linear time using max(pmin(x, 1:length(x)))
).
Otherwise, linear time is needed.