R/1.6.transformDesignToWide.R

Defines functions transformDesignToWide

transformDesignToWide <- function(modelComponents, name) {
  wideDesign <- modelComponents[[name]] %>%
    dplyr::mutate(wave = unlist(modelComponents$waves), id = unlist(modelComponents$ids)) %>%
    tidyr::pivot_wider(id_cols = id, names_from = wave, values_from = value, names_prefix = "T") %>%
    dplyr::select(tidyr::last_col())

  return(wideDesign)
}

Try the Mmcsd package in your browser

Any scripts or data that you put into this service are public.

Mmcsd documentation built on March 31, 2023, 7:23 p.m.