get_product | R Documentation |
Returns product codes for which descriptions match user-specified keywords.
get_product(pattern, origin, digits = 4, type = "regex", ignore.case = TRUE)
pattern |
String pattern to look for. The function utilizes the function |
origin |
A string indicating one of the following industry/product classifications: "HS0" (1988/92), "HS1" (1996), "HS2" (2002), "HS3" (2007), "HS4" (2012), "HS5" (2017), "HS6" (2022), "HS" (combined), "SITC1" (1950), "SITC2" (1974), "SITC3" (1985), "SITC4" (2006), "NAICS2002", "NAICS2007", "NAICS2012", "NAICS2017", "ISIC2" (1968), "ISIC3" (1989), "ISIC4" (2008), "BEC4" (2016). |
digits |
An integer indicating the preferred number of digits for output codes. The default is 4 digits. Allows 1 to 5-digit codes for the SITC classification; 2, 4, 6-digit codes for NAICS and HS classifications; 1 to 4-digit codes for the ISIC classification; 1 to 3-digit codes for the BEC classification. |
type |
A string indicating the type of pattern interpretation. Three options are available: |
ignore.case |
If TRUE (by default), pattern dection will ignore case differences. |
A character vector of product codes that match user specified description patterns.
Product descriptions consolidated from
The U.S. Census Bureau <https://www.census.gov/>
The U.S. Bureau of Labor Statistics <https://www.bls.gov/>
UN Comtrade <https://comtrade.un.org/>
UN Trade Statistics <https://unstats.un.org/unsd/trade/default.asp>
# find manufacture-related NAICS codes
manu.vec <- get_product(pattern = "manu", origin = "NAICS2017", digits = 4,
type = "regex", ignore.case = TRUE)
manu.vec
# check product description
get_desc(manu.vec, origin = "NAICS2017")
# 6-digit outputs
get_product(pattern = "manu", origin = "NAICS2017", digits = 6,
type = "regex", ignore.case = TRUE)
# choose different interpretation types
get_product(pattern = "manu", origin = "NAICS2017", digits = 4,
type = "fixed", ignore.case = TRUE)
get_product(pattern = "manu", origin = "NAICS2017", digits = 4,
type = "coll", ignore.case = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.