economiccomplexity (version 0.1.2)

proximity: Proximity

Description

Proximity

Usage

proximity(revealed_comparative_advantage = NULL, country = "country",
  product = "product", value = "value", diversity = NULL,
  diversity_country = "country", diversity_value = "value",
  ubiquity = NULL, ubiquity_product = "product",
  ubiquity_value = "value", tbl_output = FALSE)

Arguments

revealed_comparative_advantage

matrix or tibble/data.frame in long format (e.g. the output of revealed_comparative_advantage()). If it is a matrix it must be a zero/one matrix with countries in the row names and products in the column names. If revealed_comparative_advantage is a tibble/data.frame it must contain the columns. country (character/factor), product (character/factor) and discrete RCA (integer)

country

string to indicate the column that contains exporting countries (default set to "country" that is the output of revealed_comparative_advantage(), applies only if revealed_comparative_advantage is a data.frame)

product

string to indicate the column that contains exported products (default set to "product" that is the output of revealed_comparative_advantage(), applies only if revealed_comparative_advantage is a data.frame)

value

string to indicate the column that contains RCA values (default set to "value" that is the output of revealed_comparative_advantage(), applies only if revealed_comparative_advantage is a data.frame)

diversity

numeric vector or tibble/data.frame containing diversity measures (e.g. diversity from complexity_measures())

diversity_country

string to indicate the column that contains diversity countries (default set to "country" that is the output of economic_complexity_measures())

diversity_value

string to indicate the column that contains diversity values (default set to "value" that is the output of economic_complexity_measures())

ubiquity

numeric vector or tibble/data.frame containing ubiquity measures (e.g. ubiquity from complexity_measures())

ubiquity_product

string to indicate the column that contains diversity products (default set to "product" that is the output of economic_complexity_measures())

ubiquity_value

string to indicate the column that contains ubiquity values (default set to "value" that is the output of economic_complexity_measures())

tbl_output

when set to TRUE the output will be a tibble instead of a matrix (default set to FALSE)

References

For more information on proximity and its applications see:

atlas2014economiccomplexity

Examples

Run this code
# NOT RUN {
proximity(
 revealed_comparative_advantage =
  package_output_demo$revealed_comparative_advantage_matrix,
 diversity = package_output_demo$complexity_measures_numeric$diversity,
 ubiquity = package_output_demo$complexity_measures_numeric$ubiquity,
 tbl_output = TRUE
)
# }

Run the code above in your browser using DataLab