clustering: Perform cluster analysis

Description Usage Arguments Value Examples

View source: R/clustering.R

Description

Perform cluster analysis on the dataset.

Usage

1
2
clustering(dataset, method = "hc", distance = "euclidean", 
type = "samples", num.clusters = 5, clustMethod = "complete")

Arguments

dataset

list representing the dataset from a metabolomics experiment.

method

a string describing the method of clustering. Possible types are:

  • "hc" perform hierarchical clustering.

  • "kmeans" perform kmeans clustering.

distance

the distance measure to be used to compute the distances between the rows of a data matrix. Possible types are "euclidean", "manhattan", "pearson" or "spearman". Only for hierarchical clustering.

type

a string indicating if cluster analysis will be performed on samples ("samples") or on variables ("variables").

num.clusters

the number of clusters in k-means cluster analysis.

clustMethod

Cluster method for hierarchical clustering.

Value

An object of class kmeans or hclust with the clustering results.

Examples

1
2
3
4
5
6
7
  ## Example of kmeans and hierarchical clustering
  library(specmine.datasets)
  data(cachexia)
  hc.result = clustering(cachexia, method = "hc", 
	      distance = "euclidean")
  kmeans.result = clustering(cachexia, method = "kmeans", 
		  num.clusters = 4)

specmine documentation built on Sept. 21, 2021, 5:06 p.m.