Learn R Programming

causalHyperGraph (version 0.1.0)

plot.cna: Create hypergraphs from solution objects of cna() and related functions

Description

These plot() methods draw causal hypergraphs from the solution formulas included in the objects of the following classes from package cna:

  • class “cna”, the output of cna();

  • class “condTbl”, the output of condTbl(), csf(), asf() and msc();

  • class “condList”, the output of condition().

Usage

# S3 method for condTbl
plot(x, outcome = NULL, n = 10, ask = nrow(x) > 1, ...)

# S3 method for cna plot(x, what = c("csf", "asf", "msc"), ...)

# S3 method for condList plot(x, ...)

Value

These plot() methods return an object of class “causalHyperGraph”.

Arguments

x

An object of an appropriate class.

outcome

Character vector of factor names. Only solutions with one of these factors as outcome will be plotted. If NULL (default), all solutions are plotted.

n

Positive integer; specifies the maximal number of graphs to render.

ask

Logical; if TRUE, the user is asked to hit <Return> before a new graph is drawn.

...

Additional arguments in plot.condTbl() are passed to causalHyperGraph(), in particular show_formula. Additional arguments in plot.cna() and plot.condition() are passed to plot.condTbl(), e.g. n, outcome, ask.

what

One of "csf" (default), "asf", "msc", determining which type of solution to extract from the “cna” object.

Examples

Run this code
library(cna)

ana <- cna(d.educate)
pl <- plot(asf(ana))
pl

plot(csf(ana))
plot(csf(ana), ask = FALSE)

plot(ana)
plot(ana, show_formula = TRUE)
plot(ana, what = "msc", n = 5)

plot(msc(ana), outcome = "E")
plot(ana, what = "msc", outcome = "E")  # same as previous

Run the code above in your browser using DataLab