Learn R Programming

gremes (version 0.1.1)

Tree: Creates an object of class Tree

Description

An object which contains the tree and the dataset

Usage

Tree(x, data)

Value

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

Arguments

x

the graph with named nodes, an object of class igraph

data

Dataset with named columns

Examples

Run this code
g<- make_tree(7,3, mode="undirected")
g<- set.vertex.attribute(g, "name", V(g), letters[1:7])
data<- matrix(rnorm(10*7), 10,7)
colnames(data)<- get.vertex.attribute(g, "name", V(g))
# object without latent variables
Tree(x = g, data = data)
# object with latent variables
Tree(x = g, data = data[,-c(1,2)])

Run the code above in your browser using DataLab