preAggregateMultipleTLRows: Aggregate multiple rows in raw Tariff Line data.

View source: R/preAggregateMultipleTLRows.R

preAggregateMultipleTLRowsR Documentation

Aggregate multiple rows in raw Tariff Line data.

Description

Do a first aggregation of raw Tariff Line data, when possible.

Usage

preAggregateMultipleTLRows(rawdata = NA)

Arguments

rawdata

Raw TL (a tibble).

Details

Tariff Line (TL) data can have multiple rows. They can be aggregated (by taking also into account the possible different units) when value, quantity, and weight are present. Other two possibilities is to do the aggregation when weight is always missing, but quantity is always present and vice versa. When aggregation is not possible the record will be left untouched as the missing variable will be imputed in the imputation step.

Value

The original TL data after aggregation, when possible (see details). A new variable (nrows) is created and indicates the original number of rows that were aggregated.


SWS-Methodology/faoswsTrade documentation built on Feb. 13, 2023, 1:04 a.m.