concord_naics_isic: Converting NAICS and ISIC Codes

concord_naics_isicR Documentation

Converting NAICS and ISIC Codes

Description

Concords North American Industry Classification System codes (NAICS2002, NAICS2007, NAICS2012, NAICS2017) to and from International Standard Industrial Classification codes (ISIC Revision 2, 3, 3.1, 4).

Usage

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

Arguments

sourcevar

An input character vector of NAICS or ISIC codes. The function accepts 2 to 6-digit codes for NAICS and 1 to 4-digit codes for ISIC.

origin

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

destination

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

dest.digit

An integer indicating the preferred number of digits for output codes. Allows 2 to 6 digits for NAICS codes and 1 to 4 digits for 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 ISIC4 code 0111 instead of 111)—results may be buggy otherwise.

Source

Concordance tables provided by:

  • The U.S. Census Bureau <https://www.census.gov/eos/www/naics/concordances/concordances.html>

Examples

## NAICS2017 to ISIC4
concord_naics_isic(sourcevar = c("111120", "326199"),
                origin = "NAICS2017", destination = "ISIC4",
                dest.digit = 4, all = TRUE)

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