View source: R/qedata_define.R
| define | R Documentation |
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
)
x |
A data.table. The data.table to be transformed. |
metadata_cols |
A vector of column names or NULL. A vector specifying the columns for metadata transformations. |
codes_cols |
A vector of column names or NULL. A vector specifying the columns for code transformations. |
horizon_cols |
A vector of column names or NULL. A vector specifying the columns for horizon transformations. |
units_cols |
A vector of column names or NULL. A vector specifying the columns for unit transformations. |
The modified data.table after applying the metadata and code transformations.
library(data.table)
dt <- data.table(a = 1:5, b = 6:10)
dt <- define(dt, metadata = c("a"), codes = c("b"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.