Tree: Creates an object of class 'Tree'

View source: R/gr_Network.R

TreeR Documentation

Creates an object of class Tree

Description

An object which contains the tree and the dataset

Usage

Tree(x, data)

Arguments

x

the graph with named nodes, an object of class igraph

data

Dataset with named columns

Value

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

Examples

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)])

gremes documentation built on Feb. 16, 2023, 8:06 p.m.