Learn R Programming

specmine (version 3.1.6)

kmeans_clustering: Perform k-means clustering analysis

Description

Perform k-means clustering analysis on the dataset.

Usage

kmeans_clustering(dataset, num.clusters, type = "samples")

Arguments

dataset

list representing the dataset from a metabolomics experiment.

num.clusters

the number of clusters.

type

a string indicating if k-means will be performed on samples ("samples") or on variables ("variables")

Value

An object of class kmeans with the clustering results.

Examples

Run this code
# NOT RUN {
  ## Example of kmeans clustering
  library(specmine.datasets)
  data(cachexia)
  kmeans.result = kmeans_clustering(cachexia, 
		  num.clusters = 4, type = "samples")
# }

Run the code above in your browser using DataLab