ct_rca: Revealed Comparative Advantage (Balassa Index)

View source: R/analytics.R

ct_rcaR Documentation

Revealed Comparative Advantage (Balassa Index)

Description

Compute the Revealed Comparative Advantage for a country's exports. RCA > 1 indicates the country has a comparative advantage in that product.

Usage

ct_rca(reporter, year = NULL, level = 2L, cache = TRUE)

Arguments

reporter

Character. Reporter country ISO3 code.

year

Integer. Year to query.

level

Integer. HS digit level: 2, 4, or 6. Default 2.

cache

Logical. Default TRUE.

Details

The Balassa index is defined as: RCA = (country exports of product i / country total exports) / (world exports of product i / world total exports)

Value

A data.frame with columns: commodity_code, commodity_desc, reporter_value, world_value, reporter_share, world_share, rca, has_advantage.

Examples


op <- options(comtrade.cache_dir = tempdir())
rca <- ct_rca("AUS", year = 2023)
# Products where Australia has comparative advantage
rca[rca$has_advantage, ]
options(op)


comtrade documentation built on April 13, 2026, 5:07 p.m.