@@ -425,21 +425,20 @@ format_parameters.parameters_model <- function(model, ...) {
425425 unlist(preds , use.names = FALSE )
426426 ))
427427
428- # for models from pscl, we have "count_" and "zero_" prefixes, which
429- # we need to add to the "pretty_labels" names, so that we can match
430- # them with the parameters
431- if (inherits(model , c(" zeroinfl" , " hurdle" ))) {
432- pretty_labels <- c(
433- stats :: setNames(pretty_labels , paste0(" count_" , names(pretty_labels ))),
434- stats :: setNames(pretty_labels , paste0(" zero_" , names(pretty_labels )))
435- )
436- }
437-
438428 # retrieve pretty names attribute
439429 pn <- attributes(params )$ pretty_names
440430 # replace former pretty names with labels, if we have any labels
441431 # (else, default pretty names are returned)
442432 if (! is.null(pretty_labels )) {
433+ # for models from pscl, we have "count_" and "zero_" prefixes, which
434+ # we need to add to the "pretty_labels" names, so that we can match
435+ # them with the parameters
436+ if (inherits(model , c(" zeroinfl" , " hurdle" ))) {
437+ pretty_labels <- c(
438+ stats :: setNames(pretty_labels , paste0(" count_" , names(pretty_labels ))),
439+ stats :: setNames(pretty_labels , paste0(" zero_" , names(pretty_labels )))
440+ )
441+ }
443442 # check if we have any interactions, and if so, create combined labels
444443 interactions <- pn [grepl(" :" , names(pn ), fixed = TRUE )]
445444 if (length(interactions )) {
0 commit comments