make_vertices_dt: Create a data.table that can be used to load all vertices...

Description Usage Arguments Examples

Description

Given a data.table and a list containing vertices and their attributes, creates a data.table that can be used to create the vertices in an igraph graph

Usage

1
make_vertices_dt(dt, vertex_info, same_v_attr_list = NULL, parse_name = F)

Arguments

dt:

data.table containing columns for all the vertexes and vertex attributes

vertex_info:

named list, where the name is the vertex column name and the contents of each named entry is a character vector containing the names of the attribute columns to be associated with the vertex of interest

same_v_attr_list:

named list where the name is the title to resolve the associated character vector names to

parse_name:

whether or not to parse the entity_type and add it to the node name

Examples

1
2
3
4
5
Set information pertaining to which vertices and attributes will be added
vertex_info <- list(prchsr_unique = c('prchsr', 'purchase_pieces'),
                    candy = c('candy_typ', 'pieces'),
                    house = c('the_name')
same_v_attr_list <- list(all_pieces = c('purchase_pieces', 'pieces'))

zbeaver4/beavR documentation built on May 4, 2019, 9:12 p.m.