Learn R Programming

graph4lg (version 1.8.0)

plot_w_hist: Plot histograms of link weights

Description

The function enables to plot histogram to visualize the distribution of the link weights

Usage

plot_w_hist(graph, fill = "#396D35", class_width = NULL)

Value

A ggplot2 object to plot

Arguments

graph

A graph object of class igraph whose links are weighted

fill

A character string indicating the color used to fill the bars (default: "#396D35"). It must be a hexadecimal color code or a color used by default in R.

class_width

(default values: NULL) A numeric or an integer specifying the width of the classes displayed on the histogram. When it is not specified, the width is equal to the difference between the minimum and maximum values divided by 80.

Author

P. Savary

Examples

Run this code
data(data_ex_genind)
mat_w <- mat_gen_dist(data_ex_genind, dist = "DPS")
gp <- gen_graph_topo(mat_w = mat_w, topo = "gabriel")
hist <- plot_w_hist(gp)

Run the code above in your browser using DataLab