Learn R Programming

phyclust (version 0.1-34)

plotstruct: Struct Plots of Observations Based on Posterior Probabilities

Description

This function provides structure plots of data set given based on posterior probabilities, the Z.normalized matrix.

Usage

plotstruct(Z, X.class = NULL, sort.inside.class = TRUE,
    direction = "h", main = "Structure Plot", xlab = "Observations",
    ylab = "Posterior Probabilities", ...)

Value

A structure plot will be drawn.

Arguments

Z

a Z matrix as Z.normalized in Class phyclust.

X.class

class ids indicated for all observations

sort.inside.class

sort observations inside class by max posteriors.

direction

either "h" for horizontal or "v" for vertical.

main

main label, default = "Structure Plot".

xlab

x-axis label, default = "Observations".

ylab

y-axis label, default = "Posterior Probabilities".

...

other options passed to plot.

Author

Wei-Chen Chen wccsnow@gmail.com

Details

The posterior probabilities in ret.phyclust$Z.normalized will be drawn in colors.

If X.class is submitted, the plot will draw in the order of class ids and the sort.inside.class will be skipped.

References

Phylogenetic Clustering Website: https://snoweye.github.io/phyclust/

See Also

phyclust, find.best, plotdots.

Examples

Run this code
if (FALSE) {
library(phyclust, quiet = TRUE)

set.seed(1234)
ret.1 <- phyclust(seq.data.toy$org, 3)
plotstruct(ret.1$Z.normalized)
windows()
plotstruct(ret.1$Z.normalized, sort.inside.class = FALSE)

# With class ids
X.class <- as.numeric(gsub(".*-(.*)", "\\1", seq.data.toy$seqname))
windows()
plotstruct(ret.1$Z.normalized, X.class = X.class)
}

Run the code above in your browser using DataLab