profileAsClu: Plot profile(s) according to CLustering

Description Usage Arguments Value Examples

View source: R/profileAsClu.R

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
profileAsClu(
  dat,
  clu,
  meanD = NULL,
  tit = NULL,
  col = NULL,
  pch = NULL,
  xlab = NULL,
  ylab = NULL,
  meCol = "grey",
  meLty = 1,
  meLwd = 1,
  legLoc = "bottomleft",
  silent = TRUE,
  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)

legLoc

(character) legend location

silent

(logical) suppress (less important) messages

callFrom

(character) allow easier tracking of message(s) produced

Value

plot only

Examples

1
2
3
4
5
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 April 12, 2021, 1:07 a.m.