Description Usage Arguments Details References See Also Examples
Plots a graph, showing which variables occur in what edits. By default, squares represent edits, circles represent variables and an edge connecing a variable with an edit indicates that the edit contains the variable.
plot method for editarray
plot method for editset
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23  ## S3 method for class 'editmatrix'
plot(x, nodetype = "all", rules = editnames(x),
vars = getVars(x), violated = logical(nedits(x)),
adapt = logical(length(getVars(x))), nabbreviate = 5,
layout = igraph::layout.fruchterman.reingold, edgecolor = "steelblue",
rulecolor = "khaki1", varcolor = "lightblue1",
violatedcolor = "sienna1", adaptcolor = "sienna1", ...)
## S3 method for class 'editarray'
plot(x, nodetype = "all", rules = editnames(x),
vars = getVars(x), violated = logical(nedits(x)),
adapt = logical(length(getVars(x))), nabbreviate = 5,
layout = igraph::layout.fruchterman.reingold, edgecolor = "steelblue",
rulecolor = "khaki1", varcolor = "lightblue1",
violatedcolor = "sienna1", adaptcolor = "sienna1", ...)
## S3 method for class 'editset'
plot(x, nodetype = "all", rules = editnames(x),
vars = getVars(x), violated = logical(nedits(x)),
adapt = logical(length(getVars(x))), nabbreviate = 5,
layout = igraph::layout.fruchterman.reingold, edgecolor = "steelblue",
rulecolor = "khaki1", varcolor = "lightblue1",
violatedcolor = "sienna1", adaptcolor = "sienna1", ...)

x 
object of class 
nodetype 

rules 
selection of edits 
vars 
selection of variables 
violated 
A named 
adapt 
A named 
nabbreviate 

layout 
an 
edgecolor 
Color of edges and node frames 
rulecolor 
Color of rule nodes (ignored when 
varcolor 
Color of variable nodes (ignored when 
violatedcolor 
Color of nodes corresponding to violated edits (ignored when 
adaptcolor 
Color of nodes corresponding to variables to adapt (ignored when 
... 
further arguments to be passed to plot. 
Depending on the chosen nodetype
, this function can plot
three types of graphs based on an edit set.
If nodetype="all"
(default), the full bipartite graph is plotted. Each
variable is represented by a square node while each edit is represented by a circular
node. An edge is drawn when a variable occurs in an edit.
If nodetype="vars"
the variable graph is drawn. Each node represents a
variable, and an edge is drawn between two nodes if the variables occur together in at
least one edit. The edge width relates to the number of edits connecting two variables.
If nodetype="rules"
the rule graph is drawn. Each node represents an edit
rule and an edge is drawn between two nodes if they share at least one variable. The
edge width relates to the number of edits connecting the two edit rules.
The boolean vectors violated
and adapt
can be used to color violated
edits or variables which have to be adapted. The vectors must have named elements,
so variables and edit names can be matched.
The function works by coercing an editmatrix to an igraph
object, and therefore
relies on the plotting capabilities of the igraph package. For more finetuning,
use as.igraph
and see ?igraph.plotting
.
The default layout generated by the FruchtermanReingold algorithm. The resulting layout is one of several optimal layouts, generated randomly (using a attrationrepulsion model between the nodes). To reproduce layouts, use fix a randseed before calling the plot function.
Csardi G, Nepusz T: The igraph software package for complex network research, InterJournal, Complex Systems 1695. 2006. http://igraph.sf.net
as.igraph
, adjacency
, igraph.plotting
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94  ## Examples with linear (in)equality edits
# load predefined edits from package
data(edits)
edits
# convert to editmatrix
E < editmatrix(edits)
## Not run:
# (Note to reader: the Not run directive only prevents the examle commands from
# running when package is built)
# Total edit graph
plot(E)
# Graph with dependent edits
plot(E, nodetype="rules")
# Graph with dependent variables
plot(E, nodetype="vars")
# Total edit graph, but with curved lines (option from igraph package)
plot(E, edge.curved=TRUE)
# graph, plotting just the connections caused by variable 't'
plot(E,vars='t')
## End(Not run)
# here's an example with a broken record.
r < c(ct = 100, ch = 30, cp = 70, p=30,t=130 )
violatedEdits(E,r)
errorLocalizer(E,r)$searchBest()$adapt
# we color the violated edits and the variables that have to be adapted
## Not run
set.seed(1) # (for reprodicibility)
plot(E,
adapt=errorLocalizer(E,r)$searchBest()$adapt,
violated=violatedEdits(E,r))
## End(Not run)
# extract total graph (as igraph object)
as.igraph(E)
# extract graph with edges related to variable 't' and 'ch'
as.igraph(E,vars=c('t','ch'))
# extract total adjacency matrix
adjacency(E)
# extract adjacency matrix related to variables t and 'ch'
adjacency(E,vars=c('t','ch'))
## Examples with categorical edits
# generate an editarray:
E < editarray(expression(
age %in% c('<15','1665','>65'),
employment %in% c('unemployed','employed','retired'),
salary %in% c('none','low','medium','high'),
if (age == '<15') employment=='unemployed',
if (salary != 'none') employment != 'unemployed',
if (employment == 'unemployed') salary == 'none'))
## Not run:
# plot total edit graph
plot(E)
# plot with a different layout
plot(E,layout=layout.circle)
# plot edit graph, just the connections caused by 'salary'
plot(E,vars='salary')
## End(Not run)
# extract edit graph
as.igraph(E)
# extract edit graph, just the connections caused by 'salary'
as.igraph(E,vars='salary')
# extract adjacency matrix
adjacency(E)
# extract adjacency matrix, only caused by 'employment'
adjacency(E,vars='employment')

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.