Learn R Programming

FrF2 (version 2.1)

CIG: Clear interactions graph from catlg entry

Description

Function CIG creates a clear interactions graph (CIG) from a catlg design (design name must be given). Function CIGstatic allows to create a static graph from a dynamically-adjusted one.

Usage

CIG(design, select.catlg = catlg, nfac = NULL, static = FALSE, 
   layout = layout.auto, label = "num", plot = TRUE, ...)
CIGstatic(graph, id, label = "num", xlim = c(-1,1), ylim = c(1,-1), ...)
gen2CIG(nruns, gen)

Arguments

design

a character string that identifies a design in the catalogue specified by option select.catlg, OR a class catlg object with a single entry, OR a formula with all main effects and the requested clear 2-factor interactions, OR a character vector of length more than one with two-letter combinations of the clear 2-factor interactions, OR a numeric two-row matrix with factor numbers of the clear 2-factor interactions, OR a character two-row matrix with factor names of the clear 2-factor interactions. The first two are for graphing design CIGs, the other ones for requirement set CIGs.

select.catlg

name of catalogue (not in quotes); only relevant, if design is a character string

nfac

number of factors; this is not needed for a class catlg object, or if the graph is supposed to show only factors that are involved in at least one interaction

static

logical. If TRUE, a static graphic is produced, otherwise an interactive graphic is created that can be modified by moving aroung nodes; only relevant for plot=TRUE

layout

ignored for static=FALSE; possible values are two-column matrices with number of rows equal to the number of vertices of the graph, or layout parameters for function plot.igraph as described in plot.common and layout; default: layout.auto (changed with version 1.6, was layout.circle before

label

in effect for catlg object only (character design name or class catlg object); a character string that decides for numeric labels or character labels; any string other than the default will invoke the factor letters as labels

plot

a logical that decides whether a plot is requested (default: TRUE); plotting can be suppressed, if graph creation is desired for calculating graph characteristics with functions from package igraph (e.g. clique.number, largest.cliques, independence.number, degree)

further arguments to be passed to function tkplot, or graphical parameters to be passed to plot.

graph

a graph object from package igraph, or a list whose first element is such a graph object (like the output from function CIG)

id

identification number of the interactive graph to be reproduced in static form; this number can be found in the header line of the graphics window

xlim

horizontal axis limits

ylim

vertical axis limits (per default reversed in order to exactly reproduce the interactive graph)

nruns

number of runs of the design to be graphed

gen

generator (vector of Yates matrix column numbers)

Value

For plot=FALSE or plot=TRUE with static=TRUE, function CIG visibly (plot=FALSE) or invisibly (plot=TRUE) returns a graph from package igraph. For plot=TRUE with static=FALSE, the function returns a list with the first element graph the element coords with the coordinates of that graph. Function CIGstatic works on the list produced by function CIG by plotting the graph statically using the positioning from the current interactive picture.

Function gen2CIG returns a clear interactions graph that can e.g. be plotted with functions plot (plot.igraph) or tkplot.

Details

The design depicted in CIG has to be the name (character string) of a regular fractional factorial 2-level design present in select.catlg.

Clear 2fis are depicted as edges in the graph. In the interactive graph, users can change the layout manually or with the menus. For example, the Reingold-Tilford layout can be chosen, with a root vertex specified; this sometimes helps in identifying groups of vertices that are not connected with each other.

Previous versions of package igraph used to internally number the vertices from 0 to number of vertices -1, not from 1 to number of vertices. This has been changed in June 2012 (FrF2 adapted to this change with version 1.5).

Function CIGstatic serves the purpose to statically create the current interactively modified graph; the usual annotation possibilities for plots are available.

Function gen2CIG returns a graph object that can be plotted or otherwise investigated with graph-related functionality.

References

Groemping, U. (2010). Creating clear designs: a graph-based algorithm and a catalogue of clear compromise plans. Reports in Mathematics, Physics and Chemistry, report 05/2010, Department II, Beuth University of Applied Sciences Berlin. (Preprint for IIE Transactions; IIE Transactions is available at http://www.tandfonline.com.)

See Also

plot.igraph, tkplot, plot.common

Examples

Run this code
# NOT RUN {
ex.CIG <- CIG("9-4.2")
## play around with the dynamic graph until it looks right
## look up its id number in the title bar of the graph window and use it for id
par(xpd=TRUE)
CIGstatic(ex.CIG, id=1)
# }
# NOT RUN {
graph1 <- CIG("9-4.2", plot=FALSE)   ### create graph object from design name
### calculate graph properties
require(igraph)
degree(graph1)
clique.number(graph1)
independence.number(graph1)
largest.cliques(graph1)

graph2 <- gen2CIG(32, c(7,11,14,29))   ### create graph object from generator columns
### check isomorphism to graph1
graph.isomorphic(graph1,graph2)

# }
# NOT RUN {
## use a CIG for manual design search
## requirement set: 
estim <- compromise(17,15:17)$requirement ## all interactions of factors 15 to 17 (P,Q,R)
## graph the requirement set CIG
CIG(estim)
FrF2(128, 17, estimable=estim)  ## will run for a very long time
## interrupt with ESC key, after a short period of waiting
FrF2.currentlychecked()   ## displays the design that is currently checked 
                          ## should be 17-10.2407
CIG("17-10.2407")
## clearly, using columns 1, 8 and 9 for factors 15:17 does the job
    ## sometimes, the design where the algorithm got stuck, does not provide a solution
    ## in that case, option select.catlg can be used for restricting the search designs 
    ##     to designs further down in the catalogue, in order to find the next candidate
    ##     until final success is reached
    ## e.g.
    which(names(catlg)=="17-10.2407")
    FrF2(128, 17, estimable=estim, select.catlg=catlg[2375:length(catlg)])  
    ## will run for a very long time
    ## interrupting after short waiting time yields
    FrF2.currentlychecked()   ## displays the design that is currently checked 
                              ## should be 17-10.4177

## note: in this example, option sort="high" would make the automatic search fast
## so that manual treatment is not needed!

# }

Run the code above in your browser using DataLab