MyNixOS website logo
Description

Harmonizing CN8 and PC8 Product Codes.

Several functions are provided to harmonize CN8 (Combined Nomenclature 8 digits) and PC8 (Production Communautaire 8 digits) product codes over time and the classification systems HS6 and BEC. Harmonization of CN8 codes are possible by default from 1995 to 2022 and of PC8 from 2001 to 2021, respectively.

harmonizer

Innovation is a major engine of economic growth. To compare products over time, harmonization of product codes is mandatory. This package provides an easy-to-use approach to harmonize product codes. Moreover, it offers an application that allows finding all new and dropped products for given firm-level data based on harmonized product codes. Details will be provided in the upcoming paper (REFERENCE).

Installation

You can install the released version of harmonizer from CRAN with:

install.packages("harmonizer")

Examples

These examples show how to use the functions of the package. It is recommended to use the default settings of the main functions. However, it is possible to use modified versions of the functions. For more information, check vignette("harmonizer") and also the according help files.

library("harmonizer")

### default use of the main functions
my_harmonization <- harmonize_cn8(b = 2008, e = 2012)
my_harmonization <- harmonize_pc8(b = 2008, e = 2011)

### modified versions of the functions

### example for CN8 product code harmonization
hist_cn8 <- history_matrix_cn8(b = 2008, e = 2012)
bec_cn8 <- cn8_to_bec(b = 2008, e = 2012, historymatrix = hist_cn8)
my_harmonization <- harmonize_cn8(b = 2008, e = 2012, progress = TRUE, historymatrix = hist_cn8)
# however, the argument "historymatrix" is not mandatory and is calculated by default

### example for PC8 product code harmonization
hist_pc8 <- history_matrix_pc8(b = 2008, e = 2011)
bec_pc8 <- pc8_to_bec(b = 2008, e = 2011, historymatrix = hist_pc8)
my_harmonization <- harmonize_pc8(b = 2008, e = 2011, historymatrix = hist_pc8)
# however, the argument "historymatrix" is not mandatory and is calculated by default

### additional functions
get_data_directory()

get_data_directory(path = FALSE, open_explorer = TRUE, show_data = "CN8")

### harmonized analyses

# CN8 product codes
sampledata <- read_table("my_firmdata.txt", sep = ";", header = TRUE, colClasses = "character")
my_harmonization <- harmonize_cn8(b = 2008, e = 2014)
my_product_changes <- utilize_cn8(firm_data = sampledata, harmonized_data = my_harmonization, 
                                  b = 2008, e = 2014, output = "all")

changes <- my_product_changes[[1]]
merged_data <- my_product_changes[[2]]

my_product_changes <- utilize_cn8(firm_data = sampledata, harmonized_data = my_harmonization, 
                                  b = 2008, e = 2014, output = "product.changes", value = TRUE)
# however, the argument "harmonized_data" is not mandatory and is calculated by default

# PC8 product codes
sampledata <- read.table("my_firmdata.csv", sep = ";", header = TRUE, colClasses = "character")
my_harmonization <- harmonize_pc8(b = 2009, e = 2014)
my_product_changes <- utilize_pc8(firm_data = sampledata, harmonized_data = my_harmonization,
                                  b = 2009, e = 2014, output = "all")

changes <- my_product_changes[[1]]
merged_data <- my_product_changes[[2]]

my_product_changes <- utilize_pc8(firm_data = sampledata, harmonized_data = my_harmonization,
                                  b = 2009, e = 2014, output = "product.changes", value = TRUE)
# however, the argument "harmonized_data" is not mandatory and is calculated by default


### help files
?history_matrix_cn8
?cn8_to_bec
?harmonize_cn8

?history_matrix_pc8
?pc8_to_bec
?harmonize_pc8

?get_data_directory

?utilize_cn8
?utilize_pc8

### others
citation("harmonizer")
vignette("harmonizer")
news(package = "harmonizer")
Metadata

Version

0.3.2

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows