Plot profile(s) according to CLustering
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.
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 )
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 |
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 |
tit |
(character) optional custom title |
col |
(character) custom colors |
pch |
(integer) custom plotting symbols (see also |
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 |
meLwd |
(numeric) line-width line of mean/representative values (see also |
legLoc |
(character) legend location |
silent |
(logical) suppress (less important) messages |
callFrom |
(character) allow easier tracking of message(s) produced |
plot only
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)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.