Description Usage Arguments Value
Calculates if a unit is 'new' in a region through two threshold conditions. t0 threshold refer to the current time period, t1 refer to the next. A product is given value 1 for "new" in the t0 period. In other words, if the unit is newly introduced in t1, the t0 value has a "new" value. This seems unintutive, but this makes it easier to extract the relatedness metrics for the t0-period in analysis. The input data must contain the four variables listed.
1 |
data |
Data frame containing variables for time (fx year), region (fx country), unit (fx product) and rca (revealed comparative advantage or location quotient). All variables must be present. Data should follow the tidy format. |
t0_threshold |
Numeric of length 1. The value that rca should be below in current period, in order to be 'new'. |
t1_threshold |
Numeric of length 1. The value that rca should be above in next period, in order to be 'new' (only if t0_threshold also holds). |
data frame that contains the original values plus two new: previous_rca, which is the rca value for the region in the unit the previous time-period, and is_new, which takes the value 1 if the threshold conditions are passed, 0 if not. is_new is NA if there is no next rca value present (i.e. for all values in the latest time period).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.