profileAsClu: Plot profiles according to CLustering

View source: R/profileAsClu.R

profileAsCluR Documentation

Plot profiles according to CLustering

Description

This function was made for visualuzing the result of clustering of a numeric vector or clustering along multiple columns of a matrix. The data will be plotted like a reglar scatter-plot, but some extra space is added to separate clusters and dashed lines highlight cluster-borders. If no mean/representative value is spacified, a geometric mean will be calculated along all columns of dat. In case dat has multiple columns, a legend and a representative (default geometric mean) dashed grey line will be displayed.

Usage

profileAsClu(
  dat,
  clu,
  meanD = NULL,
  tit = NULL,
  col = NULL,
  pch = NULL,
  xlab = NULL,
  ylab = NULL,
  meCol = "grey",
  meLty = 1,
  meLwd = 1,
  cex = NULL,
  cexTit = NULL,
  legLoc = "bottomleft",
  silent = TRUE,
  debug = FALSE,
  callFrom = NULL
)

Arguments

dat

(matrix or data.frame) main input with data to plot as points

clu

(numeric or character) clustering results; if length=1 and character this term will be understood as colum-name with cluster-numbers from dat

meanD

(numeric) mean/representative of multiple series for display as lines; if length=1 and character this term will be understood as columname with cluster-numbers from dat

tit

(character) optional custom title

col

(character) custom colors

pch

(integer) custom plotting symbols (see also par)

xlab

(character) custom x-axis label

ylab

(character) custom y-axis label

meCol

(character) color for (dashed) line of mean/representative values

meLty

(integer) line-type line of mean/representative values (see also lty in par)

meLwd

(numeric) line-width line of mean/representative values (see also lwd in par)

cex

(numeric) cex-like expansion factor (see also par)

cexTit

(numeric) cex-like expansion factor for title (see also par)

legLoc

(character) legend location

silent

(logical) suppress messages

debug

(logical) additonal messages for debugging

callFrom

(character) allows easier tracking of messages produced

Value

This functin returns a plot only

Examples

set.seed(2020); dat1 <- runif(12)/2 + rep(6:8, each=4)
dat1Cl <- stats::kmeans(dat1, 3)$cluster
dat1Cl <- 5- dat1Cl              # bring cluster-numbers in ascending form
dat1Cl[which(dat1Cl >3)] <- 1    # bring cluster-numbers in ascending form
profileAsClu(dat1, clu=dat1Cl)

wrGraph documentation built on Oct. 20, 2023, 5:08 p.m.