| do.cut {hilbertSimilarity} | R Documentation |
Apply Cuts to the Reference Matrix
Description
Apply cuts generated using the make.cut function to the reference matrix
Usage
do.cut(mat, cuts, type = "combined")
Arguments
mat |
the matrix to cut |
cuts |
a list of cuts generated using |
type |
the type of cuts to use (use |
Details
The matrix can be cut using either the fixed cuts (type='fixed'), or the combined cuts (type='combined')
where the limits have been adjusted to match local minima and maxima.
Returned values correspond to the bin defined between the first and second threshold of the specified cuts,
then between the second and third threshold, and so on. The values will range between 0 (the first bin) and n-1 where
n is the number of values in the specified cuts.
Value
a matrix of the same dimensionality as mat where values correspond to bins defined by the type
thresholds defined cuts.
Author(s)
Yann Abraham
Examples
# generate a random 3D matrix with 2 peaks
mat <- rbind(matrix(rnorm(300),ncol=3),
matrix(rnorm(300,5,1),ncol=3))
dimnames(mat)[[2]] <- LETTERS[1:3]
# estimate the Hilbert order
hilbert.order(mat)
# generate 2 bins with a minimum bin size of 5
cuts <- make.cut(mat,n=3,count.lim=5)
show.cut(cuts)
# Generate the cuts
cut.mat <- do.cut(mat,cuts,type='fixed')
head(cut.mat)