pareto: Graph to check the 80-20 rule (Pareto principle)

View source: R/pareto.R

paretoR Documentation

Graph to check the 80-20 rule (Pareto principle)

Description

Plots a graph of the percentage of more connected nodes as a function of the percentage of the total (weighted) indegree and outdegree.

Usage

pareto(
  A,
  xlabel = "More connected nodes (%)",
  ylabel = "% of total",
  legin = "in",
  legout = "out"
)

Arguments

A

An adjacency matrix.

xlabel

The text for the x-axis label.

ylabel

The text for the y-axis label.

legin

The text for the legend of the indegree.

legout

The text for the legend of the outdegree.

Details

This function sorts in decreasing order the indegree and outdegree of the nodes of a network. Then the function calculates the percentage of more connected nodes and the corresponding percentage of the total indegree and outdegree. The indegree and outdegree can be weighted or not, depending on the adjacency matrix provided by the user.

Value

A graph of the percentage of more connected nodes as a function of the percentage of the total (weighted) indegree and outdegree for the user to check if the 80-20 rule (Pareto principle) applies to the analyzed network.

References

[1] Negreiros RL, Grisi-Filho JHH, Dias RA, Ferreira F, Ferreira Neto JS, Ossada R, Amaku M (2020). "Analysis of the Cattle Trade Network in the State of Mato Grosso, Brazil." Brazilian Journal of Veterinary Research and Animal Science, 57 (4), e171635. doi: /10.11606/issn.1678-4456.bjvras.2020.171635

Examples

# Generate an arbitrary 100 by 100 adjacency matrix with zeros and ones
# Remove loops
A <- matrix(rbinom(100 * 100, 1, 0.2), ncol = 100, nrow = 100)
diag(A) <- 0

# Call function 
pareto(A)


leb-fmvz-usp/epinemo documentation built on Nov. 27, 2022, 10:58 p.m.