projections: Projections of a Country-Product Network

View source: R/projections.R

projectionsR Documentation

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"
)

Arguments

proximity_country

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

proximity_product

(Type: dgCMatrix) 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 \insertCiteatlas2014economiccomplexity 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.

Value

A list of two graphs.

References

For more information see:

\insertRef

atlas2014economiccomplexity

and the references therein.

Examples

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

# partial view of projections
igraph::E(net$network_country)[1:5]
igraph::E(net$network_product)[1:5]


economiccomplexity documentation built on Aug. 8, 2023, 1:09 a.m.