cutWithMinN {edgeR} | R Documentation |
Discretizes a numeric vector.
Divides the range of x
into intervals, so that each interval contains a minimum number of values, and codes the values in x
according to which interval they fall.
cutWithMinN(x, intervals=2, min.n=1)
x |
numeric vector. |
intervals |
number of intervals (greater than or equal to 2). |
min.n |
minimum number of values in any interval. |
This function strikes a compromise between the base functions cut
,
which by default cuts a vector into equal length intervals,
and quantile
, which is suited to finding equally populated intervals.
A list with components:
group |
integer vector of same length as |
breaks |
numeric vector of length |
Gordon Smyth
x <- c(1,2,3,4,5,6,7,100) cutWithMinN(x,3,min.n=1)