make.cut: Generate Cutting Points for a Multidimensional Matrix

Description Usage Arguments Details Value Author(s) Examples

View source: R/make.cut.R

Description

For a given column cur.ch that belongs to a matrix, and a given number of cuts n, compute n-1 bins using either fixed of combined limits

Usage

1
make.cut(mat, n = 5, count.lim = 40)

Arguments

mat

the matrix to cut

n

the number of cuts to generate (defaults to 5)

count.lim

the minimum number of counts to consider for density (defaults to 40)

Details

the fixed limits correspond to 5 equally spaced values over the range of the column. the combined limits take the local minima and maxima determined using the localMinima and localMaxima functions, to adjust the limits using the following algorithm:

The function returns a list of lists, one for each column in mat, consisting of

Value

a list of of cuts for each column in mat, see details

Author(s)

Yann Abraham

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# 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)

hilbertSimilarity documentation built on Nov. 12, 2019, 1:06 a.m.