Learn R Programming

economiccomplexity (version 2.0.0)

projections: Projections of a Country-Product Network

Description

projections() computes two graphs that are particularly useful to visualize product-product and country-country similarity.

Usage

projections(
  proximity_country,
  proximity_product,
  avg_links = 5,
  tolerance = 0.05,
  compute = "both"
)

Value

A list of two graphs.

Arguments

proximity_country

(Type: matrix) the output from proximity()) or an equivalent arrangement.

proximity_product

(Type: matrix) the output from proximity()) or an equivalent arrangement.

avg_links

average number of connections for the projections. By default this is set to 5.

tolerance

tolerance for proximity variation on each iteration until obtaining the desired average number of connections. By default this is set to 0.05.

compute

(Type: character) the proximity to compute. By default this is "both" (both projections) but it can also be "country" or "product".

Details

The current implementation follows atlas2014economiccomplexity to create simplified graphs that correspond to a simplification of the proximity matrices. The result is obtained by iterating and reducing links until the desired average number of links per node is obtained, or a spaning tree after the strongest links is returned when is not possible to return the desired network.

References

For more information see:

atlas2014economiccomplexity

and the references therein.

Examples

Run this code
net <- projections(
  economiccomplexity_output$proximity$proximity_country,
  economiccomplexity_output$proximity$proximity_product,
  avg_links = 10,
  tolerance = 0.1
)

# partial view of projections
n <- seq_len(5)
igraph::E(net$network_country)[n]
igraph::E(net$network_product)[n]

Run the code above in your browser using DataLab