powered by
This function applies metadata and code transformations to a data.table if provided. It checks if the metadata and codes are supplied as vectors of column names.
define( x, metadata_cols = find_meta_cols(x), codes_cols = find_binary_cols(x), horizon_cols = NULL, units_cols = NULL )
The modified data.table after applying the metadata and code transformations.
A data.table. The data.table to be transformed.
A vector of column names or NULL. A vector specifying the columns for metadata transformations.
A vector of column names or NULL. A vector specifying the columns for code transformations.
A vector of column names or NULL. A vector specifying the columns for horizon transformations.
A vector of column names or NULL. A vector specifying the columns for unit transformations.
library(data.table) dt <- data.table(a = 1:5, b = 6:10) dt <- define(dt, metadata = c("a"), codes = c("b"))
Run the code above in your browser using DataLab