Description Usage Arguments Value Examples
VarNamesToFormula
returns a list of formulas (in the sense of functions
dcast
and melt
from the package
data.table) for each compound variable name included in the input vector VarNames
.
This function returns a data.table with two colums: the column Variable
with
the root names of each compound variable name, and the column Form
with the corresponding
formula having IDQual qualifiers and the sort of variable (IDDD
, IDQual
or
NonIDQual
) in its lhs and the variable qualifiers whose values appear as suffixes in the
compound variable names in the rhs. Duplicate entries in the resulting data.table
drop out.
VarNamesToFormula
is designed to be applied on compound variable names including suffixes
with qualifier values. It is fundamentally designed for the internal use in the construction of
editing strategies, but it can also be of utility in some scripts.
1 2 3 4 | VarNamesToFormula(VarNames, DD)
## S4 method for signature 'character,DD'
VarNamesToFormula(VarNames, DD)
|
VarNames |
Character vector with compound variable names. |
DD |
Object of class DD with the definition and properties of the variables. |
data.table with columns Variable
and Form
. The column
Variable
indicates the root name of each input variable name and the column Form
presents the corresponding formula.
1 2 3 4 5 6 | data(ExampleDD)
VarNamesToFormula('Turnover', ExampleDD)
VarNamesToFormula(c('Employees_1.', 'Employees_2.2', 'Employees'), ExampleDD)
VarNamesToFormula(c('Turnover', 'Employees_1.', 'Employees_2.2', 'Employees'), ExampleDD)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.