Learn R Programming

phyclust (version 0.1-9)

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", ...)

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.

Value

  • A structure plot will be drawn.

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: http://thirteen-01.stat.iastate.edu/snoweye/phyclust/

See Also

phyclust, find.best, plotdots.

Examples

Run this code
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