concord_isic: Concord Within ISIC Codes

concord_isicR Documentation

Concord Within ISIC Codes

Description

Concords codes within the International Standard Industrial Classification codes (ISIC Revision 2, 3, 3.1, 4).

Usage

concord_isic(sourcevar, origin, destination, dest.digit = 4, all = FALSE)

Arguments

sourcevar

An input character vector of ISIC codes. The function accepts 1 to 4-digit ISIC codes.

origin

A string setting the input industry classification: "ISIC2" (1968), "ISIC3" (1989), "ISIC3.1" (2002), "ISIC4" (2008).

destination

A string setting the output industry classification: "ISIC2" (1968), "ISIC3" (1989), "ISIC3.1" (2002), "ISIC4" (2008).

dest.digit

An integer indicating the preferred number of digits for output codes. Allows 1 to 4-digit ISIC codes. The default is 4 digits.

all

Either TRUE or FALSE. If TRUE, the function will return (1) all matched outputs for each input, and (2) the share of occurrences for each matched output among all matched outputs. Users can use the shares as weights for more precise concordances. If FALSE, the function will only return the matched output with the largest share of occurrences (the mode match). If the mode consists of multiple matches, the function will return the first matched output.

Value

The matched output(s) for each element of the input vector. Either a list object when all = TRUE or a character vector when all = FALSE.

Note

Always include leading zeros in codes (e.g., use ISIC3 code 0111 instead of 111)—results may be buggy otherwise.

Source

Concordance tables provided by:

  • United Nations Trade Statistics <https://unstats.un.org/unsd/trade/classifications/correspondence-tables.asp>

Examples

# ISIC3 to ISIC2
concord_isic(sourcevar = c("0111", "1721"),
             origin = "ISIC3", destination = "ISIC2",
             dest.digit = 4, all = TRUE)

insongkim/concordance documentation built on Aug. 22, 2024, 6:53 p.m.