Skip to content

Commit 121e41e

Browse files
committed
fix
1 parent aae7445 commit 121e41e

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

R/utils_format.R

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -592,19 +592,12 @@
592592
# if model has any distributional parameters, check if it's fixed or random
593593
# and create component header
594594
if (!is.null(dpars)) {
595-
# add aliases
596-
if ("zoi" %in% dpars) {
597-
dpars <- c(dpars, "zero_one_inflated")
598-
}
599-
if ("coi" %in% dpars) {
600-
dpars <- c(dpars, "conditional_one_inflated")
601-
}
602595
type_parts <- unlist(strsplit(type, ".", fixed = TRUE))
603596
if (type_parts[1] %in% dpars) {
604-
if (identical(type_parts[2], "fixed")) {
605-
component_name <- paste(type_parts[1], "Parameters")
606-
} else if (identical(type_parts[2], "random")) {
597+
if (identical(type_parts[2], "random")) {
607598
component_name <- paste(type_parts[1], "Random Effects")
599+
} else if (identical(type_parts[2], "fixed") || length(type_parts) < 2) {
600+
component_name <- paste(type_parts[1], "Parameters")
608601
}
609602
}
610603
}
@@ -696,8 +689,9 @@
696689
}
697690

698691
# clean some special parameter names
699-
component_name <- gsub("zero_one_inflated", "Zero-One-Inflated", component_name)
700-
component_name <- gsub("conditional_one_inflated", "Conditional-One-Inflated", component_name)
692+
component_name <- gsub("zi", "Zero-Inflation", component_name)
693+
component_name <- gsub("zoi", "Zero-One-Inflation", component_name)
694+
component_name <- gsub("coi", "Conditional-One-Inflation", component_name)
701695

702696
# if we show ZI component only, make sure this appears in header
703697
if (!grepl("(Zero-Inflation Component)", component_name, fixed = TRUE) &&

0 commit comments

Comments
 (0)