https://github.com/cran/bayestestR
Revision 2565fc870cd7f0a64d857ff89e682dc9344dc7c1 authored by Dominique Makowski on 12 February 2020, 04:10 UTC, committed by cran-robot on 12 February 2020, 04:10 UTC
1 parent 40f7c88
Raw File
Tip revision: 2565fc870cd7f0a64d857ff89e682dc9344dc7c1 authored by Dominique Makowski on 12 February 2020, 04:10 UTC
version 0.5.2
Tip revision: 2565fc8
utils_clean_stan_parameters.R
#' @keywords internal
.clean_up_tmp_stanreg <- function(tmp, group, cols, parms) {
  tmp$Group <- group
  tmp$Parameter <- rep(parms, each = nrow(tmp) / length(parms))
  rownames(tmp) <- NULL
  tmp <- tmp[, c("Parameter", cols)]
  # clean random effects notation from parameters
  # tmp$Parameter <- gsub("b\\[(.*) (.*)\\]", "\\2", tmp$Parameter)
  tmp
}


#' @keywords internal
.clean_up_tmp_brms <- function(tmp, group, component, cols, parms) {
  tmp$Group <- group
  tmp$Component <- component
  tmp$Parameter <- rep(parms, each = nrow(tmp) / length(parms))
  rownames(tmp) <- NULL
  tmp <- tmp[, c("Parameter", cols)]
  # clean random effects notation from parameters
  # tmp$Parameter <- gsub("r_(.*)\\.(.*)\\.", "\\1", tmp$Parameter)
  tmp
}
back to top