Create the Cartesian product of two or more data sets, preserving all variables from each input data set.
genCrossed(..., id = "cross_id")A `data.table` containing all combinations of rows from the input data sets. The crossed id is placed first and used as the key.
region_def <- defData(varname = "r_effect", formula = 0, variance = 1)
mouse_def <- defData(varname = "m_effect", formula = 0, variance = 1)
dd_region <- genData(20, region_def, id = "region")
dd_mouse <- genData(8, mouse_def, id = "mouse")
dd <- genCrossed(
dd_mouse,
dd_region,
id = "mouse_region_id"
)