DF.to.long | R Documentation |
reshape
This utility function takes a simulated data.frame in wide format as an input and converts it into a long format (slower compared to DF.to.longDT
).
DF.to.long(df_wide)
df_wide |
A |
Keeps all covariates that appear only once and at the first time-point constant (carry-forward).
All covariates that appear fewer than range(t) times are imputed with NA for missing time-points.
Observations with all NA's for all time-varying covariates are removed.
When removing NA's the time-varying covariates that are attributes (attnames) are not considered.
A data.frame
object in long format
DF.to.longDT
- a faster version of DF.to.long
that uses data.table
package
Other data manipulation functions:
DF.to.longDT()
,
doLTCF()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.