https://github.com/cran/bayestestR
Raw File
Tip revision: aee422d7cd4098dad89e31ecc6dfd9e539d2bda4 authored by Dominique Makowski on 06 August 2019, 10:20 UTC
version 0.2.5
Tip revision: aee422d
utils_get_parameter_names.R
#' @importFrom insight find_parameters
.get_parameter_names <- function(posterior, effects, component, parameters) {
  pars <- insight::find_parameters(posterior, flatten = FALSE, parameters = parameters)

  pars <- switch(
    effects,
    "fixed" = pars[c("conditional", "zero_inflated")],
    "random" = pars[c("random", "zero_inflated_random")],
    "simplex" = pars["simplex"],
    "smooth_terms" = pars["smooth_terms"],
    "all" = pars
  )

  pars <- switch(
    component,
    "conditional" = pars[c("conditional", "random", "simplex", "smooth_terms")],
    "zi" = ,
    "zero_inflated" = pars[c("zero_inflated", "zero_inflated_random", "simplex", "smooth_terms")],
    "all" = pars
  )

  unlist(pars)
}
back to top