Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Oct 13, 2023
1 parent cc30cd0 commit 571b4b5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 3 additions & 1 deletion R/plot.parameters_model.R
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,9 @@ plot.see_parameters_model <- function(x,
} else if (has_response) {
p <- p + facet_wrap(~Response, ncol = n_columns, scales = facet_scales)
} else if (has_subgroups) {
suppressWarnings(p <- p + facet_grid(Subgroup ~ ., scales = "free", space = "free")) # nolint
suppressWarnings({
p <- p + facet_grid(Subgroup ~ ., scales = "free", space = "free")
})
}

if (length(model_attributes$parameter_names) > 1L) {
Expand Down
4 changes: 2 additions & 2 deletions R/print.check_model.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ print.see_check_model <- function(x,
# to plot(), "type" is no longer recognized as "missing()"
plot_type <- attr(x, "type")

if (missing(type) && !is.null(plot_type) && plot_type %in% c("density", "discrete_dots", "discrete_interval", "discrete_both")) {
if (missing(type) && !is.null(plot_type) && plot_type %in% c("density", "discrete_dots", "discrete_interval", "discrete_both")) { # nolint
type <- plot_type
} else {
type <- match.arg(type, choices = c("density", "discrete_dots", "discrete_interval", "discrete_both"))
}

suppressWarnings(suppressMessages(plot(
suppressWarnings(suppressMessages(graphics::plot(
x,
style = style,
colors = colors,
Expand Down
6 changes: 4 additions & 2 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
return(x)
}


.as.data.frame_density <- function(x, ...) {
data.frame(x = x$x, y = x$y)
}


# safe conversion from factor to numeric
.factor_to_numeric <- function(x) {
if (is.numeric(x)) {
Expand All @@ -27,11 +29,13 @@
as.numeric(as.character(x))
}


.has_multiple_panels <- function(x) {
(!"Effects" %in% names(x) || insight::n_unique(x$Effects) <= 1L) &&
(!"Component" %in% names(x) || insight::n_unique(x$Component) <= 1L)
}


.clean_parameter_names <- function(params, grid = FALSE) {
params <- unique(params)
labels <- params
Expand Down Expand Up @@ -90,7 +94,6 @@
}



.fix_facet_names <- function(x) {
if ("Component" %in% names(x)) {
x$Component <- as.character(x$Component)
Expand All @@ -117,7 +120,6 @@
}



.intercept_names <-
c(
"(intercept)_zi",
Expand Down

0 comments on commit 571b4b5

Please sign in to comment.