DF.to.long: Convert Data from Wide to Long Format Using 'reshape'

Description Usage Arguments Details Value See Also

View source: R/simulation.r


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).





A data.frame in wide format


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

See Also

DF.to.longDT - a faster version of DF.to.long that uses data.table package

Other data.manipulation.functions: DF.to.longDT, doLTCF

simcausal documentation built on May 19, 2017, 10:21 p.m.

Search within the simcausal package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.