Closed tbates closed 4 years ago
# Just make a long data set to play with
data(twinData); tmp = twinData[, -2]; tmp$twinID1 = 1; tmp$twinID2 = 2
long = umx_wide2long(data = tmp, sep = "")
# make it wide!
wide = umx_long2wide(data= long, famID= "fam", twinID= "twinID", zygosity= "zygosity",
vars2keep = c("bmi", "wt"), passalong = "cohort"
)
namez(wide)
table(wide$zygosity)
support families/zygosities where twin 1 is always missing
BUG: zygosities 2, 4, 5, 6, should be preserved in the wide data: 5 is being dropped... CAUSE: might be because zyg 5 consists of only twin 2 (OS) males...
Here's a minimal reproducible example:
h/t @nathanGillespie