Learn R Programming

rEMM (version 1.0-5)

plot: Visualize EMM Objects

Description

Visualize EMM objects.

Usage

## S3 method for class 'EMM,missing':
plot(x, y, method=c("igraph", "interactive", 
    "graph", "MDS", "cluster_counts", "transition_counts"), data = NULL, 
    parameter=NULL, ...)

Arguments

x
an EMM object.
y
unused (just for compatibility with the generic for plot in graphics)
method
see details section.
data
Project the state centers onto these data. Points which do not belong to any cluster are shown in blue.
parameter
a list of parameters for plotting.
...
further arguments passed on to plot.default.

Details

There are several methods for plotting:

"igraph" produces a graph representation of the EMM using igraph. Additional arguments like layout are passed on to plot for igraph.

"interactive" produces an interactive graph representation of the EMM (using igraph). Arguments suitable for plot in igraph can be passed on as ....

"graph" produces a graph representation of the EMM using Rgraphviz. If Rgraphviz is not installed/available then the method reverts to "igraph".

"MDS" projects the cluster centers into 2-dimensional space.

"cluster_counts" produces a barplot for cluster counts.

"transition_counts" produces a barplot for transition counts.

The following plotting parameters are currently supported (by some of the visualizations): [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

For some plots (e.g., "igraph") ... is passed on to the primitive plotting function and can be used to change the plot (colors, etc.) See ? igraph.plotting. For "graph" the two special parameters "nAttrs" and "eAttrs" for node and edge attributes can be used.

See Also

EMM

Examples

Run this code
data("EMMTraffic")
emm <- EMM(threshold=0.2, measure="eJaccard", data=EMMTraffic)

op <- par(mfrow = c(2, 2), pty = "s")
plot(emm, main="Graph (plain)", 
    parameter=list(cluster_counts=FALSE, arrow_width=FALSE))
plot(emm, main="Graph")
plot(emm, method="MDS", main="MDS projection", 
    xlim=c(-0.5,0.5), ylim= c(-0.5,0.5))
plot(emm, method="MDS", data = EMMTraffic, 
	main = "Projection of centers on data")
par(op)

## Example to create a fixed layout for igraph
g <- as.igraph(emm)
l <- layout.star(g)
plot(emm, layout=l)

Run the code above in your browser using DataLab