Learn R Programming

gremes (version 0.1.1)

GTree: Creates object of class GTree

Description

Creates object of class GTree

Usage

GTree(g, Data)

Value

An object containing the graph and the data whose columns are associated to the nodes.

Arguments

g

should be the graph, an object of class igraph with named nodes

Data

is the dataset with named columns

Examples

Run this code
g<- graph(c(1,2,2,3), directed=FALSE)
g<- set.vertex.attribute(g, "name", V(g), c("a", "b", "c")) # name the nodes of the graph
data<- matrix(rnorm(10*3), 10,3)
colnames(data)<- c("a", "b", "c") # name the columns of the data
gt<- GTree(g = g, Data = data)

Run the code above in your browser using DataLab