evaluateClustering: evaluateClustering

Description Usage Arguments Value Examples

View source: R/scrna_evaluationFunctions.R

Description

Evaluates a clustering using 'true' labels. Entries with missing true labels (i.e. NA) are excluded from calculations.

Usage

1

Arguments

x

The clustering labels

tl

The true labels

Value

A numeric vector of metrics (see the 'pipeComp_scRNA' vignette for details)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# random data
dat <- data.frame( 
 cluster=rep(LETTERS[1:3], each=10),
 x=c(rnorm(20, 0), rnorm(10, 1)),
 y=c(rnorm(10, 1), rnorm(20, 0))
)
# clustering
dat$predicted <- kmeans(dist(dat[,-1]),3)$cluster
# evaluation
evaluateClustering(dat$predicted, dat$cluster)

pipeComp documentation built on Nov. 8, 2020, 7:35 p.m.