View source: R/estimationdata.R
EstimationDataTemplate | R Documentation |
Inspects the input dataframe and creates a list of lists. Each list element takes the name of the variable and contains information about the variable with a sublist. Such information includes the type of the variable (numeric or factor), and other metadata attributes such as the label of the variable, the name of the variable, question type of the variable, the dataset it originates from and others.
EstimationDataTemplate(x, outcome.name)
x |
A |
outcome.name |
An optional name of the outcome variable. Should be a character(1L) string.
If specified it will be set as the |
A list of lists. The list will have an attribute called "outcome.name"
which will be
set to the value of the outcome.variable
argument or NA_character_
if not
provided. Each sublist contains information about each variable from the input
data.frame
with the following elements:
type: The type of the variable (numeric or factor)
label: The label of the variable
name: The name of the variable
questiontype: The question type of the variable
question: The question of the variable
dataset: The dataset of the variable
levels: If variable is a factor, the levels of the variable, otherwise not present
observed.levels: If variable is a factor, the observed levels of the variable, otherwise not present
has.unobserved.levels: Boolean indicating whether the variable has unobserved levels
ordered: If variable is a factor, whether the factor is ordered, otherwise not present
default.value: The default value of the variable, the minimum if numeric or the first (observed) level if factor
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.