R/1.6.transformResponseToWide.R

Defines functions transformResponseToWide

transformResponseToWide <- function(modelComponents) {
  wideResponse <- modelComponents$response %>%
    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(-id)

  return(wideResponse)
}

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.