gModel {gRbase} | R Documentation |
The general class gModel
contains a formula object and a
gmData
object. Implementations of different
specific graphical model classes can inherit from this class and
provide methods for parsing the formula. This is illustrated in the
implementation of a class for hierarchical log–linear models,
hllm
.
gModel(formula, gmData) addEdge(object, name.1, name.2) dropEdge(object, name.1, name.2) addVertex(object, name) dropVertex(object, name)
formula |
an object of class formula . |
gmData |
an object of class gmData . |
object |
an object of class gModel . |
name |
a string with a name of a variable available in
gmData to be added or removed from the model formula. |
name.1 |
a string with a name of a variable available in
gmData to mark the first node in the edge to be added or
dropped from the model. |
name.2 |
a string with a name of a variable available in
gmData to mark the second node in the edge to be added or
dropped from the model.. |
gModel
creates an object of class gModel
with the two
components formula
and gmData
. These components can be
retrieved or replaced using the accessor functions of the same
names. Also, a gModel
object may be manipulated using the
dynamicGraph
interface.
Søren Højsgaard, sorenh@agrsci.dk,
Claus Dethlefsen, aas.claus.dethlefsen@nja.dk
gmData
, gRfit
, hllm
, dynamic.Graph
.
data(rats) rats <- as.gmData(rats) m1 <- gModel(~.^. , rats) m1.form <- formula(m1) m1.data <- gmData(m1) observations(gmData(m1)) <- observations(rats)[1:10,]