Learn R Programming

hilbertSimilarity (version 0.4.3)

add.cut: Add New Cut Thresholds

Description

Add new manual cuts to the cuts matrix generated using make.cut

Usage

add.cut(cuts, new.cuts, cut.id = "manual", update = FALSE)

Arguments

cuts

a list of cuts generated using make.cut

new.cuts

a list of new cut thresholds to be added to cuts

cut.id

string identifying the new cuts

update

if FALSE (the default) adding a cut.id that already exists in cuts will return an error

Value

an updated cuts matrix with an extra set of thresholds named cut.id.

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.

Examples

Run this code
# NOT RUN {
# 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)
# }

Run the code above in your browser using DataLab