findk: Finding the number of overlapped and well-separated clusters...

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/findk.R

Description

Counts the well-separated and overlapped rectangular blocks tracing their edges. The count is proposed as the number of clusters for the given dataset.

Usage

1
findk(img, disp=FALSE)

Arguments

img

A numeric binary image matrix of the ordered dissimilarities. It can be produced by using the function binimage of the package.

disp

A logical value whether the binary image will be displayed or not. Default is TRUE.

Details

Tracing the edges starts with the first cell on the last row of binary image matrix. The functions detects the corners of blocks and then changes the moving direction.

Value

k

Number of clusters

edges

Vector of the detected directions for the edges of rectangle blocks.

Author(s)

Zeynel Cebeci

References

Cebeci, Z. & Yildiz, F. (2015). Gorsel Kumelenme Egilimi Degerlendirmesi ve R'de Uygulamasi. Cukurova Universitesi Ziraat Fakultesi Dergisi, 30(2):1-8. (URL: https://dergipark.org.tr/en/download/article-file/219860)

See Also

binimage, findk2, genbinimg, greyimage, vatimage, vatdisp

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# Generate a binary image having 6 rectangle blocks over its diagonal.
binmat <- genbinimg(nb=6, disp=FALSE)$binimg
k <- findk(binmat, disp=TRUE)$k
cat("Number of clusters detected:", k, "\n")

# Load the dataset protocarbo 
data(protcarbo) 
# Obtain the VAT matrix 
vatmat <- vatimage(protcarbo, disp=FALSE)$odm
greymat <- greyimage(vatmat, greylevel=256)
binmat <- binimage(greymat, method="auto")$binimg
# Find the number of clusters
k <- findk(binmat, disp=TRUE)$k
cat("Number of clusters detected:", k, "\n")

zcebeci/VatAna documentation built on Dec. 25, 2019, 7:07 p.m.