Add mean shapes back to the original data, matched by group.
Usage
# S3 method for class 'stat_meanshape'
collect(x, data = NULL, prefix = "mean_", ...)Details
For grouped mean shapes, mean shapes are matched back to original rows by group membership. For global mean shapes, the same mean is added to all rows.
New columns added:
{prefix}{coe_col}: Mean coefficient column (e.g.,mean_VD){prefix}{coe_col}_i: Mean shape (e.g.,mean_VD_i)
Examples
if (FALSE) { # \dontrun{
ms <- vitis %>% stat_meanshape(status)
# Add mean shapes to data
vitis_with_means <- collect(ms)
# Custom prefix
vitis_with_means <- collect(ms, prefix = "grp_mean_")
} # }
