Learn R Programming

sgraph (version 1.1.0)

add_edge_color: Modify the edge colors of a sgraph object.

Description

Modify the edge colors of a sgraph object by providing a single color. Also works with a vector of correct size.

Usage

add_edge_color(
  sigma_obj,
  one_color = NULL,
  color_attr = NULL,
  color_palette = "Set2"
)

Value

sgraph with modified edge colors

Arguments

sigma_obj

sgraph object

one_color

A single color to color all of the nodes (hex format)

color_attr

The name of an edge attribute

color_palette

Name of RColorBrewer palette to use

Examples

Run this code
library(igraph)
library(sgraph)

data(lesMis)

sig <- sigma_from_igraph(igraph = lesMis) %>%
  add_edge_color(one_color = "#ccc")
sig

Run the code above in your browser using DataLab