gRbase: A package for graphical modelling in R

The gRbase package provides certain general constructs which are used by other graphical modelling packages, in particular by the packages gRain, gRim and gRc. . gRbase contains several datasets relevant for use in connection with graphical models. Almost all datasets used in the book Graphical Models with R (2012) are contained in gRbase. . gRbase implements several graph algorithms (based mainly on representing graphs as adjacency matrices - either in the form of a standard matrix or a sparse matrix). Some graph algorithms are: (i) maximum cardinality search (for marked and unmarked graphs). (ii) moralize. (iii) triangulate. (iv) junctionTree. . gRbase facilities for array operations, . gRbase implements functions for testing for conditional independence. . gRbase illustrates how hierarchical log-linear models (hllm) may be implemented and describes concept of gmData (graphical meta data). These features, however, are not maintained anymore and remains in gRbase only because there exists a paper describing these facilities: A Common Platform for Graphical Models in R: The gRbase Package, Journal of Statistical Software, Vol 14, No 17, 2005.

AuthorSren Hjsgaard <> with contributions from Claus Dethlefsen <> and Clive Bowsher <>
Date of publication2013-01-30 11:39:10
MaintainerSren Hjsgaard <>
LicenseGPL (>= 2)

View on R-Forge

Man pages

arrayCombine: Combine arrays

combnPrim: Generate All Combinations of n Elements Taken m at a Time

compareModels: Generic function for model comparison

compile-propagate: Compile and propagate functions

cov2pcor: Partial correlation (matrix)

DATA-ashtrees: Crown dieback in ash trees

DATA-BodyFat: Body Fat Data

DATA-breastcancer: Gene expression signatures for p53 mutation status in 250...

DATA-cad: Coronary artery disease data

DATA-carcass: Lean meat contents of 344 pig carcasses

DATA-chestSim: Simulated data from the Chest Clinic example

DATA-dietox: Growth curves of pigs in a 3x3 factorial experiment

DATA-dumping: Gastric Dumping

DATA-lizard: Lizard behaviour

DATA-mathmark: Mathematics marks for students

DATA-mildew: Mildew fungus

DATA-milkcomp: Milk composition data

DATA-Nutrimouse: The Nutrimouse Dataset

DATA-rats: Weightloss of rats

DATA-reinis: Risk factors for coronary heart disease.

DATA-wine: Chemical composition of wine

GraphAlgo-edgeList: Find edges in a graph and edges not in a graph.

GraphAlgo-glist2adjMAT: Creates adjacency matrix for a graph from a list of...

GraphAlgo-is-graph: Check properties of graphs.

GraphAlgo-mcs: Maximum cardinality search on undirected graph.

GraphAlgo-minimalTriang: Minimal triangulation of an undirected graph

GraphAlgo-moralize: Moralize a directed acyclic graph

GraphAlgo-mpd: Maximal prime subgraph decomposition

GraphAlgo-operations1: Simple operations on undirected and directed acyclic graphs.

GraphAlgo-querygraph: Query a graph

GraphAlgo-rip: RIP ordering and junction tree.

GraphAlgo-topoSort: Topological sort of vertices in directed

GraphAlgo-triangulate: Triangulation of an undirected graph

GraphAlgo-vpar: List of vertices and their parents for graph.

gRbase: The package 'gRbase': summary information

gRbase-internal: Internal gRbase functions

gRbase-utilities: Utility functions for gRbase

iplot: Function for plotting graphs using the 'igraph' package.

parray: Representation of and operations on multidimensional tables

randomDag: Random directed acyclic graph

removeRedundant: Set operations

table-operations: Compute table margin or table slice

ugdag: Create undirected and directed graphs

ZOLD-gmData: Class "gmData" graphical meta data

ZOLD-gModel: Class "gModel" - graphical models

ZOLD-gRfit: Class "gRfit" - fitted graphical models

ZOLD-hllm: Hierarchical log-linear models

ZOLD-validVarTypes: Admissible variable types in gmData objects


addEdge Man page
addEdge.gModel Man page
all.subsets Man page
ancestors Man page
ancestralGraph Man page
ancestralSet Man page
aperm2 Man page
arrayCombine Man page
arrayExtendDomain Man page
as.adjMAT Man page
asdgCMatrix Man page
asdgCMatrix.matrix Man page
asdgCMatrix.Matrix Man page
as.gmData Man page
as.gmData.array Man page Man page
as.gmData.table Man page
ashtrees Man page
as.parray Man page
BodyFat Man page
breastcancer Man page
cad1 Man page
cad2 Man page
carcass Man page
carcassall Man page
cell2entry Man page
chestSim Man page
chestSim1000 Man page
chestSim10000 Man page
chestSim100000 Man page
chestSim500 Man page
chestSim50000 Man page
children Man page
closure Man page
coerceGraph Man page
coerceGraph.graphNEL Man page
coerceGraph.igraph Man page
coerceGraph.matrix Man page
colmat2list Man page
colSumsPrim Man page
colwiseProd Man page
combnPrim Man page
compareModels Man page
compile Man page
conc2pcor Man page
contains Man page
cov2pcor Man page
dag Man page
dagList Man page
dagListMAT Man page
dagMAT Man page
data2parray Man page
dataOrigin Man page
dataOrigin.gmData Man page
description Man page
description<- Man page
description<-.gmData Man page
description.gmData Man page
dietox Man page
dropEdge Man page
dropEdge.gModel Man page
dual.rep Man page
dumping Man page
edgeList Man page
edgeList.graphNEL Man page
edgeListMAT Man page
edgeList.matrix Man page
ell Man page
ellK Man page
entry2cell Man page
extract.power Man page
factGrid Man page
fit Man page
fit.ggm Man page
fit.hllm Man page
formula Man page
formula<- Man page
formula<-.gModel Man page
formula.gModel Man page
getCellNumberC Man page
getFit Man page
getFit<- Man page
getFit<-.gRfit Man page
getFit.gRfit Man page
ggm Man page
glist2adjMAT Man page
gmData Man page
gmData<- Man page
gmData<-.gModel Man page
gmData.gModel Man page
gModel Man page
gModel-class Man page
graphNEL2ftM Man page
gRbase Man page
gRfit Man page
gRfit-class Man page
hllm Man page
hllm-class Man page
igraph-class Man page
in.list Man page
intersectPrim Man page
iplot Man page
iplot.graphNEL Man page
ips Man page
is.adjMAT Man page
is.complete Man page
is.cont Man page
is.DAG Man page
is.DAG.graphNEL Man page
is.DAGMAT Man page
is.DAG.matrix Man page
is.DAG.Matrix Man page
is.decomposition Man page
is.graphical Man page
isGSD_glist Man page
isin Man page
is.insetlist Man page
is.simplicial Man page
is.subsetof Man page
is.TUG Man page
is.TUG.graphNEL Man page
is.TUGMAT Man page
is.TUG.matrix Man page
is.TUG.Matrix Man page
is.UG Man page
is.UG.graphNEL Man page
is.UGMAT Man page
is.UG.matrix Man page
is.UG.Matrix Man page
jTree Man page
jTree.graphNEL Man page
jTree.igraph Man page
jTree.matrix Man page
jTree.Matrix Man page
junctionTree Man page
junctionTree.graphNEL Man page
junctionTree.igraph Man page
junctionTree.matrix Man page
junctionTree.Matrix Man page
lapplyI2V Man page
lapplyMatch Man page
lapplyV2I Man page
latent Man page
latent<- Man page
latent<-.gmData Man page
latent.gmData Man page
list2rhsf Man page
list2rhsFormula Man page
lizard Man page
lizardAGG Man page
lizardRAW Man page
makeDimNames Man page
matchPrim Man page
math Man page
mathmark Man page
matrix2list Man page
maximalSets Man page
mcs Man page
mcs.graphNEL Man page
mcs.igraph Man page
mcsmarked Man page
mcsmarked.graphNEL Man page
mcsmarked.igraph Man page
mcsmarkedMAT Man page
mcsmarked.matrix Man page
mcsMAT Man page
mcsMATR Man page
mcs.matrix Man page
mcs.Matrix Man page
mcsMAT_spCpp Man page
mcsMAT_spR Man page
mcsMAT_stC Man page
mcsMAT_stCpp Man page
mcsMAT_stR Man page
mildew Man page
milkcomp Man page
milkcomp1 Man page
minimalSets Man page
minimalTriang Man page
minimalTriangMAT Man page
moralize Man page
moralize.graphNEL Man page
moralize.igraph Man page
moralizeMAT Man page
moralize.matrix Man page
moralize.Matrix Man page
moralizeMAT_spC Man page
moralizeMAT_stR Man page
moralMAT Man page
mpd Man page
mpdMAT Man page
names2pairs Man page
newgmData Man page
nextCell Man page
nextCellSlice Man page
nLevels Man page
nLevels<- Man page
nLevels.array Man page
nLevels<-.gmData Man page
nLevels.gmData Man page
nLevels.parray Man page
nominal Man page
nominal<- Man page
nominal<-.gmData Man page
nominal.gmData Man page
nonEdgeList Man page
nonEdgeList.graphNEL Man page
nonEdgeListMAT Man page
nonEdgeList.matrix Man page
Nutrimouse Man page
obs Man page
observations Man page
observations<- Man page
observations<-.gmData Man page
observations.gmData Man page
ordinal Man page
ordinal<- Man page
ordinal<-.gmData Man page
ordinal.gmData Man page
outerPrim Man page
outfun Man page
pairs2num Man page
parents Man page
parray Man page
partial.corr.matrix Man page
permuteCellEntries Man page
plot.ripOrder Man page
print.gmData Man page
print.gModel Man page
print.gRfit Man page
print.parray Man page
print.ripOrder Man page
processFormula Man page
propagate Man page
properties_glist Man page
querygraph Man page
random_dag Man page
rats Man page
readf Man page
readg Man page
reinis Man page
removeRedundant Man page
rhsf2list Man page
rhsFormula2list Man page
rip Man page
rip.graphNEL Man page
rip.igraph Man page
ripMAT Man page
ripMAT2 Man page
rip.matrix Man page
rip.Matrix Man page
rowmat2list Man page
rowSumsPrim Man page
selectOrder Man page
setdiffPrim Man page
shortNames Man page
shortNames<- Man page
shortNames<-.gmData Man page
shortNames.gmData Man page
showf Man page
showg Man page
simplicialNodes Man page
slice2entry Man page
solveSPD Man page
sp_fromto Man page
sp_getXi Man page
sp_getXij Man page
sp_getXj Man page
sp_getXM Man page
sp_getXtf Man page
sp_moralize Man page
sp_setXij1 Man page
sp_setXM1 Man page
sp_setXtf1 Man page
sp_topoSort Man page
stepwise Man page
stepwise.default Man page
stepwise.hllm Man page
st_fromto Man page
subsetof Man page
summary.gmData Man page
summary.gRfit Man page
tableDiv Man page
tableMargin Man page
tableMult Man page
tableOp Man page
tableOp2 Man page
tablePerm Man page
tableSlice Man page
tableSlicePrim Man page
topoSort Man page
topoSort.graphNEL Man page
topoSortMAT Man page
topoSort.matrix Man page
topoSort.Matrix Man page
topoSortMAT_spCpp Man page
topoSortMAT_stCpp Man page
topoSort_vparList Man page
triang2R Man page
triangulate Man page
triangulate.graphNEL Man page
triangulate.igraph Man page
triangulateMAT Man page
triangulate.matrix Man page
triangulate.Matrix Man page
triangulateMAT_spCpp Man page
triangulateMAT_spR Man page
triangulateMAT_stC Man page
triangulateMAT_stCpp Man page
ug Man page
ugList Man page
ugListMAT Man page
ugMAT Man page
uniquePrim Man page
unlistPrim Man page
update.gModel Man page
validVarTypes Man page
valueLabels Man page
valueLabels<- Man page
valueLabels.array Man page
valueLabels<-.gmData Man page
valueLabels.gmData Man page
valueLabels.parray Man page
varNames Man page
varNames<- Man page
varNames.array Man page
varNames<-.gmData Man page
varNames.gmData Man page
varNames.parray Man page
varset Man page
varTypes Man page
varTypes<- Man page
varTypes<-.gmData Man page
varTypes.gmData Man page
vpaL2adjMAT Man page
vpaL2tfM Man page
vpar Man page
vpar.graphNEL Man page
vparlist2tf Man page
vparMAT Man page
vpar.matrix Man page
vpar.Matrix Man page
which.arr.ind Man page
wine Man page


R/dualRep.R R/GraphAlgo-moralize.R R/ZOLD-ggm.R R/graphAlgo-triangulateMAT-C.R R/xxxPrim.R R/arrayCombine.R R/graphAlgo-topoSortMAT-C.R R/AddDropEdges.R R/GraphAlgo-ugdag.R R/yyyPrim.R R/ZOLD-gRfit.R R/GraphAlgo-mcsmarked.R R/GraphAlgo-isGSD.R R/dgCMatrix.R R/Generics.R R/solveSPD.R R/iplot.R R/GraphAlgo-cliqueMAT.R R/GraphAlgo-minimalTriang.R R/GraphAlgo-vpar.R R/GraphAlgo-edgeList.R R/random_dag.R R/arrayops.R R/sparseM.R R/FIX-stepwise.R R/processFormula.R R/ZOLD-gModel.R R/GraphAlgo-is-graph.R R/parray.R R/table-operations.R R/globals.R R/asdgCMatrix-C.R R/zzz.R R/GraphAlgo-rip.R R/gRbase-utilities.R R/GraphAlgo-coerce.R R/setopsC.R R/ZOLD-gmData.R R/GraphAlgo-MPD.R R/ZOLD-hllm.R R/names2pairs.R R/ZOLD-update_gModel.R R/graphAlgo-topoSort.R R/combnPrimR.R R/GraphAlgo-querygraph.R R/graphAlgo-mcsMAT-C.R R/FIX-formulae.R R/GraphAlgo-mcs.R R/GraphAlgo-JunctionTree.R R/GraphAlgo-xxx2adjmat.R R/graphAlgo-triangulate.R R/setopsR.R
man/DATA-reinis.Rd man/GraphAlgo-edgeList.Rd man/DATA-milkcomp.Rd man/DATA-mildew.Rd man/DATA-cad.Rd man/ZOLD-gRfit.Rd man/ZOLD-gModel.Rd man/DATA-Nutrimouse.Rd man/ZOLD-hllm.Rd man/DATA-dumping.Rd man/DATA-dietox.Rd man/cov2pcor.Rd man/parray.Rd man/GraphAlgo-querygraph.Rd man/gRbase-utilities.Rd man/ZOLD-gmData.Rd man/table-operations.Rd man/DATA-carcass.Rd man/GraphAlgo-topoSort.Rd man/randomDag.Rd man/combnPrim.Rd man/ZOLD-validVarTypes.Rd man/GraphAlgo-operations1.Rd man/GraphAlgo-glist2adjMAT.Rd man/GraphAlgo-triangulate.Rd man/gRbase.Rd man/iplot.Rd man/compareModels.Rd man/GraphAlgo-rip.Rd man/DATA-mathmark.Rd man/GraphAlgo-minimalTriang.Rd man/DATA-BodyFat.Rd man/GraphAlgo-mpd.Rd man/DATA-rats.Rd man/ugdag.Rd man/arrayCombine.Rd man/GraphAlgo-vpar.Rd man/GraphAlgo-mcs.Rd man/DATA-lizard.Rd man/gRbase-internal.Rd man/DATA-ashtrees.Rd man/GraphAlgo-moralize.Rd man/GraphAlgo-is-graph.Rd man/DATA-breastcancer.Rd man/compile-propagate.Rd man/DATA-wine.Rd man/removeRedundant.Rd man/DATA-chestSim.Rd
demo/carcass.R demo/haireye.R demo/reinis.R
demo/cadcomplete.R demo/gmData.R

Questions? Problems? Suggestions? or email at

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.