Remove redundant smoothing option

This commit is contained in:
2024-10-05 14:36:37 -04:00
parent ddcc26050f
commit 180e1ca81a

View File

@@ -776,19 +776,15 @@ generate_scatter_plot <- function(plot, config) {
plot <- plot + geom_point(shape = 3, color = "gray70", size = 1) plot <- plot + geom_point(shape = 3, color = "gray70", size = 1)
} }
# Add Smooth Line if specified # Add linear regression line if specified
if (!is.null(config$smooth) && config$smooth) { if (!is.null(config$lm_line)) {
smooth_color <- if (!is.null(config$smooth_color)) config$smooth_color else "blue" plot <- plot +
geom_abline(
if (!is.null(config$lm_line)) { intercept = config$lm_line$intercept,
plot <- plot + slope = config$lm_line$slope,
geom_abline( color = ifelse(!is.null(config$lm_line$color), config$lm_line$color, "blue"),
intercept = config$lm_line$intercept, linewidth = ifelse(!is.null(config$lm_line$linewidth), config$lm_line$linewidth, 1)
slope = config$lm_line$slope, )
color = smooth_color,
linewidth = 1
)
}
} }
# Add SD Bands if specified # Add SD Bands if specified
@@ -1072,11 +1068,11 @@ generate_interaction_plot_configs <- function(df_summary, df_interaction, type)
x_labels = as.character(unique(group_data$conc_num)), x_labels = as.character(unique(group_data$conc_num)),
ylim_vals = y_limits, ylim_vals = y_limits,
y_filter = FALSE, y_filter = FALSE,
smooth = TRUE,
lm_line = list( lm_line = list(
intercept = lm_intercept_value, intercept = lm_intercept_value,
slope = lm_slope_value, slope = lm_slope_value,
color = "blue" color = "blue",
linewidth = 1
) )
) )
delta_plot_configs <- append(delta_plot_configs, list(plot_config)) delta_plot_configs <- append(delta_plot_configs, list(plot_config))
@@ -1219,11 +1215,10 @@ generate_correlation_plot_configs <- function(df) {
label = paste("R-squared =", round(r_squared, 3)) label = paste("R-squared =", round(r_squared, 3))
) )
), ),
smooth = TRUE,
smooth_color = "tomato3",
lm_line = list( lm_line = list(
intercept = intercept, intercept = intercept,
slope = slope slope = slope,
color = "tomato3"
), ),
shape = 3, shape = 3,
size = 0.5, size = 0.5,