| panel_data | R Documentation |
Format your data for use with panelr.
panel_data(data, id = id, wave = wave, ...)
as_pdata.frame(data)
as_panel_data(data, ...)
## Default S3 method:
as_panel_data(data, id = id, wave = wave, ...)
## S3 method for class 'pdata.frame'
as_panel_data(data, ...)
as_panel(data, ...)
data |
A data frame. |
id |
The name of the column (unquoted) that identifies
participants/entities. A new column will be created called |
wave |
The name of the column (unquoted) that identifies
waves or periods. A new column will be created called |
... |
Attributes for adding onto this method. See
|
When the first input to dplyr::bind_rows() is a panel_data object,
the result retains its panel identifiers and is sorted by entity and wave.
Source labels requested with .id stay attached to their original rows.
Direct vctrs operations preserve the requested row order; after reordering
rows, call panel_data() again before computing lags or leads.
as_panel_data() also accepts plm::pdata.frame() objects. If their index
columns have been removed, they are restored from the saved panel index.
A panel_data object.
data("WageData")
wages <- panel_data(WageData, id = id, wave = t)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.