rubikclust: Unsupervised clustering to detect rough structures and...

Description Usage Arguments Details Value Examples

View source: R/rubikClust.R

Description

Handle and operate on Nx3 matrix, where N is the number of samples and data are collected on 3 variables.

Usage

1
rubikclust(X, min.space = 0.4, rotation = TRUE)

Arguments

X

A data matrix for which rows represent samples and the 3 columns represent features. Missingness is not allowed.

min.space

A value to specify a minimum space between 2 consecutive projected values. Default = 0.4.

rotation

To specify if rotation is enabled or not. Default = TRUE.

Details

The function rubikClust is able to take up to 3 variables (N x 3 matrix). In case, a matrix contains more than 3 columns, only the first three columns are used; the other columns are ignored.

Value

The returned value is a vector of numbers representing cluster memberships.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#Load simulated dataset
data(example_SNP)

PCs <- cal.pc.linear(simsnp$snp, no.pc = 3)

#Run rubikclust with the default parameters
groups <- rubikclust(PCs$PC)
#Check clustering results
print(groups)

#Check cluster's distribution
table(groups)

#Check the plot, highlight the points according to the clustering result
mylabels <- paste0("group", as.factor(groups))
plot3views( PCs$PC, labels = mylabels)

#Run rubikclust with min.space = 0.02
groups <- rubikclust(PCs$PC, min.space = 0.02)
#Check clustering results
print(groups)

#Check cluster's distribution
table(groups)

#Check the plot, highlight the points according to the clustering result
mylabels <- paste0("group", as.factor(groups))
plot3views( PCs$PC, labels = mylabels)

KRIS documentation built on Jan. 21, 2021, 5:08 p.m.