PomaClust: Cluster Analysis

View source: R/PomaClust.R

PomaClustR Documentation

Cluster Analysis

Description

PomaClust performs a k-means clustering and plots the results in a classical multidimensional scaling (MDS) plot.

Usage

PomaClust(
  data,
  method = "euclidean",
  k = NA,
  k_max = floor(min(dim(data))/2),
  show_clusters = TRUE,
  labels = FALSE
)

Arguments

data

A SummarizedExperiment object.

method

Character. Indicates the distance method to perform MDS. Options are "euclidean", "maximum", "manhattan", "canberra" and "minkowski". See ?dist().

k

Numeric. Indicates the number of clusters (default is NA). The optimal number of clusters will be used by default.

k_max

Numeric. Indicates the number of clusters among which the optimal k will be selected.

show_clusters

Logical. Indicates if clusters should be plotted or not.

labels

Logical. Indicates if sample names should be plotted or not.

Value

A list with results including plots and tables.

Author(s)

Pol Castellano-Escuder

Examples

## Output is a list with objects `mds_coordinates` (tibble), `mds_plot` (ggplot2 object), `optimal_clusters_number` (numeric value), `optimal_clusters_number` (numeric value), and `optimal_clusters_plot` (ggplot2 object)
data <- POMA::st000284 # Example SummarizedExperiment object included in POMA

data %>% 
  PomaClust(method = "euclidean",
            k = NA,
            k_max = floor(min(dim(data))/2), 
            show_clusters = TRUE,
            labels = FALSE)

pcastellanoescuder/POMA documentation built on Nov. 18, 2024, 10:41 p.m.