Set basic attributes from totu table

c_net_set(
  go,
  ...,
  vertex_group = "v_group",
  vertex_class = "v_class",
  vertex_size = "size",
  edge_type = "e_type",
  edge_class = "e_class",
  edge_width = "width",
  node_break = 5,
  edge_break = 5,
  initialize = TRUE
)

Arguments

go

metanet an igraph object

...

some data.frames to annotate go

vertex_group

choose which column to be vertex_group (map to vertex_shape)

vertex_class

choose which column to be vertex_class (map to vertex_color)

vertex_size

choose which column to be vertex_size (map to vertex_size)

edge_type

choose which column to be edge_type (map to edge_color)

edge_class

choose which column to be edge_class (map to edge_linetype)

edge_width

choose which column to be edge_width (map to edge_width)

node_break

node_break if v_class is numeric, default: 5

edge_break

edge_break if e_type is numeric, default: 5

initialize

initialize, default: TRUE

Value

a metanet object

See also

Examples

data("otutab", package = "pcutils")
t(otutab) -> totu
metadata[, 3:10] -> env

data("c_net")
co_net <- c_net_set(co_net, taxonomy, data.frame("Abundance" = colSums(totu)),
  vertex_class = "Phylum", vertex_size = "Abundance"
)
#> 8 attributes will be overwrited:
#> Kingdom, Phylum, Class, Order, Family, Genus, Species, Abundance
co_net2 <- c_net_set(co_net2, taxonomy, data.frame(name = colnames(env), env = colnames(env)),
  vertex_class = c("Phylum", "env")
)
#> 8 attributes will be overwrited:
#> Kingdom, Phylum, Class, Order, Family, Genus, Species, env
co_net2 <- c_net_set(co_net2, data.frame("Abundance" = colSums(totu)), vertex_size = "Abundance")
#> 1 attributes will be overwrited:
#> Abundance