coerceColumnTypes: Coerce Column Types

Description Usage Arguments Details Value

Description

Currently, the working system may not provide the correct column types for datasets, and this can cause problems during joins at later stages (as keys are sometimes numeric and sometimes character, and a failure to match leads to errors). Thus, this function coerces all column types that it can, based on the aupusParam argument. For example, aupusParam$keyNames$areaName gives the name of the area id column of data, and thus this column should always be coerced to a numeric column.

Usage

1
coerceColumnTypes(aupusParam, data)

Arguments

aupusParam

A list of running parameters to be used in pulling the data. Typically, this is generated from getAupusParameter (see that function for a description of the required elements).

data

The data.table whose column types should be coerced.

Details

Note: there is currently a ticket in the SWS (issues SWS-797) that should resolve this problem. However, we need a work-around until that issue has been resolved.

Value

A data.table with updated column types.


SWS-Methodology/faoswsAupus documentation built on May 9, 2019, 11:45 a.m.