indAggregate: Aggregate ISIC

Description Usage Arguments Details Author(s) See Also Examples

Description

Aggregate industries ISIC Rev. 3 and ISIC Rev. 4

listMissInd: for each missing aggregate, list missing industries. Return NULL if all industries are missing for an aggregate

Usage

1
2
3
4
5
indAggregate(data = stop("'data' must be specified"), isic = 3,
  cumulative = FALSE, naAsZero = NULL, fill2D = FALSE,
  missing.2d = NULL, part = FALSE, print.missing = FALSE)

listMissInd(data, isic, drop = FALSE)

Arguments

data

a dataframe having STAN industry labels (ISIC Rev. 3 or ISIC Rev. 4) as column names.

isic

an integer specifying the ISIC classification of data sources.

cumulative

logical to cumulate values if aggregate already existing in data.

naAsZero

character vector to specify industries where NAs are treated as zero, ALL for all industries.

fill2D

logical add column with NA or zero for each missing 2-digit industry

missing.2d

character vector with industries to impute zero, NULL for all 2-digit

part

logical industry codes in column names contain partial information, e.g. D01T03part. Use with fill2D=TRUE in case of part aggregates and some 2-digits

Details

Calculate STAN ISIC Rev. 3 aggregates based on the A60 list and STAN ISIC Rev. 4 aggregates based on the A88 list.

listMissInd(data, isic)

Author(s)

OECD STAN

See Also

loadDim

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## ISIC Rev. 3:
x <- data.frame("cou"="JPN",
                "year"=c(rep(1995, 4), rep(1996,4)),
                "ind"=c("C01", "C02", "C05", "C10"),
                "value"=c(10, 10, 10, 10))
data <- dcast(x,cou + year ~ ind, value.var='value')
data.agg <- indAggregate(data=data, isic=3)
## ISIC Rev. 4:
x <- data.frame("cou"="JPN",
                "year"=c(rep(1995, 4), rep(1996,4)),
                "ind"=c("D01", "D02", "D03", "D05"),
                "value"=c(10, 10, 10, 10))
data <- dcast(x,cou + year ~ ind, value.var='value')
data.agg <- indAggregate(data=data, isic=4)

bowerth/stan documentation built on May 13, 2019, 12:38 a.m.