R/mvregmed.graph.attributes.R

Defines functions mvregmed.graph.attributes

Documented in mvregmed.graph.attributes

mvregmed.graph.attributes <- function(fit.edges, x.color ="palegreen",
                                      y.color="palevioletred", 
                                      med.color="skyblue", v.size=30){
  ## setup graph attributes
    edges <- as.matrix(fit.edges$all.edge)
    gr  <- graph_from_edgelist(edges, directed=TRUE)
    vname  <- vertex_attr(gr )$name
    vsize  <- rep(v.size, length(vname ))
    vcol  <- rep(x.color, length(vname))
    vcol[vname %in% fit.edges$y.name] <- y.color
    vcol[vname%in% fit.edges$med.name] <- med.color
    return(list(gr=gr, vname=vname, vsize=vsize, vcol=vcol))
 }

Try the regmed package in your browser

Any scripts or data that you put into this service are public.

regmed documentation built on Jan. 22, 2023, 1:30 a.m.