Learn R Programming

pecan (version 0.1.0)

rca: Revealed Comparative Advantage Index / Balassa Index

Description

Compute the revealed comparative advantage (RCA) index balassa1965tradepecan for a given dataset.

Usage

rca(
  data,
  binary = TRUE,
  threshold = 1,
  econ = "economy",
  prod = "product",
  exp = "export"
)

Value

An economy-by-product matrix with the RCA values.

Arguments

data

A data frame or matrix containing the data.

  • If a data frame, it should have columns representing economies, products, and export values.

  • If a matrix, it should be an economy-by-product matrix with export values.

binary

A boolean (default = TRUE) specifying whether to return binary RCA values (1 if RCA >= threshold, 0 otherwise).

threshold

A numeric value (default = 1) specifying the threshold for binary RCA values.

econ

A character string (default = "economy") specifying the column name for economies when data is a data frame.

prod

A character string (default = "product") specifying the column name for products when data is a data frame.

exp

A character string (default = "export") specifying the column name for export values when data is a data frame.

References