Skip to content

Commit

Permalink
rename parameters to alpha_* pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
IndrajeetPatil committed Nov 21, 2024
1 parent 21a9a9a commit 4c09de2
Show file tree
Hide file tree
Showing 36 changed files with 151 additions and 151 deletions.
6 changes: 3 additions & 3 deletions R/plot.bayesfactor_parameters.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#' The `plot()` method for the `bayestestR::bayesfactor_parameters()` function.
#'
#' @param size_point Numeric specifying size of point-geoms.
#' @param rope_alpha Numeric specifying transparency level of ROPE ribbon.
#' @param alpha_rope Numeric specifying transparency level of ROPE ribbon.
#' @param color_rope Character specifying color of ROPE ribbon.
#' @param show_intercept Logical, if `TRUE`, the intercept-parameter is included
#' in the plot. By default, it is hidden because in many cases the
Expand All @@ -20,7 +20,7 @@
plot.see_bayesfactor_parameters <- function(x,
size_point = 2,
color_rope = "#0171D3",
rope_alpha = 0.2,
alpha_rope = 0.2,
show_intercept = FALSE,
...) {
if ("log_BF" %in% names(x) && !"BF" %in% names(x)) {
Expand Down Expand Up @@ -81,7 +81,7 @@ plot.see_bayesfactor_parameters <- function(x,
ymin = 0,
ymax = Inf,
fill = color_rope,
alpha = rope_alpha
alpha = alpha_rope
)
} else {
p <- p +
Expand Down
4 changes: 2 additions & 2 deletions R/plot.check_homogeneity.R
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ plot.see_check_homogeneity <- function(x, data = NULL, ...) {
size_axis_title = 10,
base_size = 10,
colors = unname(social_colors(c("green", "blue", "red"))),
dot_alpha_level = 0.8,
alpha_dot = 0.8,
show_dots = TRUE) {
p <- ggplot2::ggplot(x, ggplot2::aes(x = .data$x, .data$y))

Expand All @@ -149,7 +149,7 @@ plot.see_check_homogeneity <- function(x, data = NULL, ...) {
geom_point2(
colour = colors[2],
size = size_point,
alpha = dot_alpha_level
alpha = alpha_dot
)
}

Expand Down
22 changes: 11 additions & 11 deletions R/plot.check_model.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ plot.see_check_model <- function(x,
size_axis_title <- attr(x, "axis_title_size")
size_title <- attr(x, "title_size")
alpha_level <- attr(x, "alpha")
dot_alpha_level <- attr(x, "dot_alpha")
alpha_dot <- attr(x, "alpha_dot")
show_dots <- attr(x, "show_dots")
detrend <- attr(x, "detrend")
model_info <- attr(x, "model_info")
Expand Down Expand Up @@ -73,8 +73,8 @@ plot.see_check_model <- function(x,
alpha_level <- 0.2
}

if (is.null(dot_alpha_level)) {
dot_alpha_level <- 0.8
if (is.null(alpha_dot)) {
alpha_dot <- 0.8
}

if (is.null(base_size)) {
Expand Down Expand Up @@ -124,7 +124,7 @@ plot.see_check_model <- function(x,
size_axis_title = size_axis_title,
size_title = size_title,
colors = colors,
dot_alpha_level = dot_alpha_level,
alpha_dot = alpha_dot,
show_dots = show_dots
)
}
Expand Down Expand Up @@ -168,7 +168,7 @@ plot.see_check_model <- function(x,
size_axis_title = size_axis_title,
size_title = size_title,
colors = colors,
dot_alpha_level = dot_alpha_level,
alpha_dot = alpha_dot,
show_dots = show_dots
)
}
Expand All @@ -185,7 +185,7 @@ plot.see_check_model <- function(x,
size_title = size_title,
base_size = base_size,
colors = colors,
dot_alpha_level = dot_alpha_level,
alpha_dot = alpha_dot,
show_dots = show_dots
)
}
Expand All @@ -212,7 +212,7 @@ plot.see_check_model <- function(x,
linewidth = linewidth,
size_point = 0.9 * size_point,
alpha = alpha_level,
dot_alpha = dot_alpha_level,
alpha_dot = alpha_dot,
colors = colors,
detrend = detrend,
style = style,
Expand All @@ -232,7 +232,7 @@ plot.see_check_model <- function(x,
theme_style = style,
base_size = base_size,
colors = colors,
dot_alpha_level = dot_alpha_level,
alpha_dot = alpha_dot,
show_dots = TRUE, # qq-plots w/o dots makes no sense
model_info = model_info,
model_class = model_class
Expand Down Expand Up @@ -264,7 +264,7 @@ plot.see_check_model <- function(x,
theme_style = style,
base_size = base_size,
colors = colors,
dot_alpha_level = dot_alpha_level,
alpha_dot = alpha_dot,
show_dots = TRUE # qq-plots w/o dots makes no sense
)

Expand Down Expand Up @@ -292,7 +292,7 @@ plot.see_check_model <- function(x,
theme_style = theme_lucid,
base_size = 10,
colors = unname(social_colors(c("green", "blue", "red"))),
dot_alpha_level = 0.8,
alpha_dot = 0.8,
show_dots = TRUE) {
p <- ggplot2::ggplot(x, ggplot2::aes(x = .data$x, y = .data$y))

Expand All @@ -301,7 +301,7 @@ plot.see_check_model <- function(x,
geom_point2(
colour = colors[2],
size = size_point,
alpha = dot_alpha_level
alpha = alpha_dot
)
}

Expand Down
26 changes: 13 additions & 13 deletions R/plot.check_normality.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#' `"pp"` for probability-probability (P-P) plots, or
#' `"density"` for density overlay plots.
#' @param linewidth Numeric value specifying size of line geoms.
#' @param dot_alpha Numeric value specifying alpha level of the point geoms.
#' @param alpha_dot Numeric value specifying alpha level of the point geoms.
#' @param alpha Numeric value specifying alpha level of the confidence bands.
#' @param colors Character vector of length two, indicating the colors (in
#' hex-format) for points and line.
Expand Down Expand Up @@ -48,7 +48,7 @@ plot.see_check_normality <- function(x,
size_axis_title = base_size,
base_size = 10,
alpha = 0.2,
dot_alpha = 0.8,
alpha_dot = 0.8,
colors = c("#3aaf85", "#1b6ca8"),
detrend = TRUE,
method = "ell",
Expand Down Expand Up @@ -96,7 +96,7 @@ plot.see_check_normality <- function(x,
linewidth = linewidth,
size_point = size_point,
alpha = alpha,
dot_alpha = dot_alpha,
alpha_dot = alpha_dot,
colors = colors,
detrend = detrend,
base_size = base_size,
Expand All @@ -120,7 +120,7 @@ plot.see_check_normality <- function(x,
base_size = base_size,
alpha_level = alpha,
detrend = detrend,
dot_alpha_level = dot_alpha,
alpha_dot = alpha_dot,
model_info = model_info,
method = method,
model_class = class(model)[1]
Expand Down Expand Up @@ -160,7 +160,7 @@ plot.see_check_normality <- function(x,
size_title = size_title,
alpha_level = alpha,
detrend = detrend,
dot_alpha_level = dot_alpha,
alpha_dot = alpha_dot,
method = method
)
}
Expand Down Expand Up @@ -222,7 +222,7 @@ plot.see_check_normality <- function(x,
theme_style = theme_lucid,
base_size = 10,
colors = unname(social_colors(c("green", "blue", "red"))),
dot_alpha_level = 0.8,
alpha_dot = 0.8,
show_dots = TRUE,
model_info = NULL,
model_class = NULL) {
Expand Down Expand Up @@ -259,7 +259,7 @@ plot.see_check_normality <- function(x,
stroke = 0,
size = size_point,
colour = colors[2],
alpha = dot_alpha_level,
alpha = alpha_dot,
detrend = detrend
),
qqplotr::stat_qq_line(
Expand Down Expand Up @@ -358,7 +358,7 @@ plot.see_check_normality <- function(x,
theme_style = theme_lucid,
base_size = 10,
colors = unname(social_colors(c("green", "blue", "red"))),
dot_alpha_level = 0.8) {
alpha_dot = 0.8) {
if (requireNamespace("qqplotr", quietly = TRUE)) {
p_plot <- ggplot2::ggplot(x, ggplot2::aes(sample = .data$res)) +
qqplotr::stat_pp_band(alpha = alpha_level, detrend = detrend, bandType = method) +
Expand All @@ -371,7 +371,7 @@ plot.see_check_normality <- function(x,
shape = 16, stroke = 0,
size = size_point,
colour = colors[2],
alpha = dot_alpha_level,
alpha = alpha_dot,
detrend = detrend
)
} else if (requireNamespace("MASS", quietly = TRUE)) {
Expand All @@ -391,7 +391,7 @@ plot.see_check_normality <- function(x,
mapping = if (detrend) ggplot2::aes(y = .data$y - .data$probs),
colour = colors[2],
size = size_point,
alpha = dot_alpha_level
alpha = alpha_dot
)
} else {
insight::format_error("Package 'qqplotr' OR 'MASS' required for P-P plots. Please install one of them.")
Expand Down Expand Up @@ -430,7 +430,7 @@ plot.see_check_normality <- function(x,
theme_style = theme_lucid,
base_size = 10,
colors = unname(social_colors(c("green", "blue", "red"))),
dot_alpha_level = 0.8,
alpha_dot = 0.8,
show_dots = TRUE) {
lapply(names(x), function(i) {
dat <- x[[i]]
Expand All @@ -452,7 +452,7 @@ plot.see_check_normality <- function(x,
ggplot2::aes(ymin = .data$conf.low, ymax = .data$conf.high),
width = 0,
colour = colors[2],
alpha = dot_alpha_level
alpha = alpha_dot
) +
theme_style(
base_size = base_size,
Expand All @@ -467,7 +467,7 @@ plot.see_check_normality <- function(x,
geom_point2(
colour = colors[2],
size = size_point,
alpha = dot_alpha_level
alpha = alpha_dot
)
}

Expand Down
4 changes: 2 additions & 2 deletions R/plot.check_outliers.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ plot.see_check_outliers <- function(x,
size_title = 12,
size_axis_title = base_size,
base_size = 10,
dot_alpha = 0.8,
alpha_dot = 0.8,
colors = c("#3aaf85", "#1b6ca8", "#cd201f"),
rescale_distance = TRUE,
type = c("dots", "bars"),
Expand All @@ -55,7 +55,7 @@ plot.see_check_outliers <- function(x,
size_axis_title = size_axis_title,
size_title = size_title,
base_size = base_size,
dot_alpha_level = dot_alpha,
alpha_dot = alpha_dot,
colors = colors
)
} else if (length(outlier_methods) == 1) {
Expand Down
4 changes: 2 additions & 2 deletions R/plot.check_outliers_new.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
theme_style = theme_lucid,
base_size = 10,
colors = unname(social_colors(c("green", "blue grey", "red"))),
dot_alpha_level = 0.8,
alpha_dot = 0.8,
show_dots = TRUE) {
linewidth <- linewidth %||% 0.7
size_text <- size_text %||% 3
Expand All @@ -30,7 +30,7 @@
p <- p + geom_point2(
aes(colour = .data$Influential),
na.rm = na.rm,
alpha = dot_alpha_level,
alpha = alpha_dot,
size = size_point
)
}
Expand Down
Loading

0 comments on commit 4c09de2

Please sign in to comment.