widen_panel | R Documentation |
This function takes panel_data()
objects as input as converts
them to wide format for use in SEM and other situations when such a format
is needed.
widen_panel(data, separator = "_", ignore.attributes = FALSE, varying = NULL)
data |
The |
separator |
When the variables are labeled with the wave number,
what should separate the variable name and wave number? By default,
it is "_". In other words, a variable named |
ignore.attributes |
If the |
varying |
If you want to skip the checks for whether variables are
varying and specify yourself, as is done with |
This is a wrapper for stats::reshape()
, which is renowned for being
pretty confusing to use. This function automatically detects which of the
variables vary over time and which don't, not appending wave information
to constants.
A data.frame with 1 row per respondent.
reshape
wages <- panel_data(WageData, id = id, wave = t)
wide_wages <- widen_panel(wages)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.