getClusterCenters: Get cluster centers

View source: R/utility_functions.R

getClusterCentersR Documentation

Get cluster centers

Description

For given dimensional reduction (e.g., UMAP), return cluster center coordinates.

Usage

getClusterCenters(df, which.center = "mean")

Arguments

df

data.frame with columns 'x' and 'y' specifying dimensional reduction coordinates, and column 'cluster' or 'clusters' specifying cluster membership.

which.mean

Specify which central values to use. One of 'mean' or 'median'. Default is 'mean'.

Value

df.centers

Author(s)

Nicholas Mikolajewicz

Examples


# compute cluster centers
which.center <- "mean"
df.red.centers <- get.cluster.centers(df.red, which.center)


NMikolajewicz/scMiko documentation built on June 28, 2023, 1:41 p.m.