Description Usage Arguments Value See Also Examples
View source: R/cm_long2dummy.R
Stretches and dummy codes a cm_xxx2long dataframe to allow for combining columns.
1 2 3 4 5 6 7 | cm_long2dummy(
dataframe,
rm.var = NULL,
code = "code",
start = "start",
end = "end"
)
|
dataframe |
A dataframe that contains the person variable. |
rm.var |
An optional character argument of the name of a repeated measures column. |
code |
A character argument of the name of a repeated measures column.
Default is |
start |
A character argument of the name of a repeated measures column.
Default is |
end |
A character argument of the name of a repeated measures column.
Default is |
Returns a dataframe or a list of stretched and dummy coded dataframe(s).
cm_range2long
,
cm_time2long
,
cm_df2long
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ## Not run:
foo <- list(
AA = qcv(terms="1:10"),
BB = qcv(terms="1:2, 3:10, 19"),
CC = qcv(terms="1:3, 5:6")
)
foo2 <- list(
AA = qcv(terms="4:8"),
BB = qcv(terms="1:4, 10:12"),
CC = qcv(terms="1, 11, 15:20"),
DD = qcv(terms="")
)
(x <- cm_range2long(foo))
cm_long2dummy(x)
(z <- cm_range2long(foo, foo2, v.name="time"))
out <- cm_long2dummy(z, "time")
ltruncdf(out)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.