Learn R Programming

pcalg (version 1.1-4)

pcAlgo-class: Class "pcAlgo"

Description

This class of objects is returned by the functions skeleton and pc to represent the (skeleton) of an estimated CPDAG. Objects of this class have methods for the functions plot, show and summary.

Arguments

Creation of objects

Objects can be created by calls of the form new("pcAlgo", ...) or by function call to skeleton or pc.

Extends

Class "gAlgo".

See Also

pc, skeleton, fciAlgo

Examples

Run this code
showClass("pcAlgo")

## generate a pcAlgo object
p <- 8
set.seed(45)
myDAG <- randomDAG(p, prob = 0.3)
n <- 10000
d.mat <- rmvDAG(n, myDAG, errDist = "normal")
indepTest <- gaussCItest
suffStat <- list(C = cor(d.mat), n = n)
alpha <- 0.01
pc.fit <- pc(suffStat, indepTest, p, alpha)

## use methods of class pcAlgo
show(pc.fit)
if(require(Rgraphviz))
  plot(pc.fit)
summary(pc.fit)

## access slots of this object
(g  <- pc.fit@graph)
str(ss <- pc.fit@sepset, max=1)

Run the code above in your browser using DataLab