Skip to content

Commit 874e094

Browse files
committed
# refactor: rename log_scale to log_y
This commit renames the log_scale parameter to log_y in the plot_predicted_curve function for improved clarity. All related documentation, examples, and tests have been updated to reflect this change.
1 parent 3a12b24 commit 874e094

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

R/plot_predicted_curve.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#' @param legend_median Label for the median prediction line.
2424
#' @param show_quantiles [logical]; if [TRUE] (default), plots the 2.5%, 50%,
2525
#' and 97.5% quantiles.
26-
#' @param log_scale [logical]; if [TRUE], applies a [log10] transformation to
26+
#' @param log_y [logical]; if [TRUE], applies a [log10] transformation to
2727
#' the y-axis.
2828
#' @param log_x [logical]; if [TRUE], applies a [log10] transformation to the
2929
#' x-axis.
@@ -35,7 +35,7 @@
3535
#' limits.
3636
#' @param ylab (Optional) A string for the y-axis label. If `NULL` (default),
3737
#' the label is automatically set to "ELISA units" or "ELISA units (log scale)"
38-
#' based on the `log_scale` argument.
38+
#' based on the `log_y` argument.
3939
#'
4040
#' @return A [ggplot2::ggplot] object displaying predicted antibody response
4141
#' curves with a median curve and a 95% credible interval band as default.
@@ -125,7 +125,7 @@ plot_predicted_curve <- function(sr_model,
125125

126126
# Determine Y-axis label
127127
if (is.null(ylab)) {
128-
if (log_scale) {
128+
if (log_y) {
129129
ylab <- "ELISA units (log scale)"
130130
} else {
131131
ylab <- "ELISA units"
@@ -231,7 +231,7 @@ plot_predicted_curve <- function(sr_model,
231231
)
232232

233233
# --- Optionally add log10 scales for y and/or x ---
234-
if (log_scale) {
234+
if (log_y) {
235235
p <- p + ggplot2::scale_y_log10()
236236
}
237237
if (log_x) {

inst/examples/examples-plot_predicted_curve.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ p1 <- plot_predicted_curve(
3030
legend_obs = "Observed data",
3131
legend_median = "Median prediction",
3232
show_quantiles = TRUE,
33-
log_scale = FALSE,
33+
log_y = FALSE,
3434
log_x = FALSE,
3535
show_all_curves = TRUE
3636
)
@@ -45,7 +45,7 @@ p2 <- plot_predicted_curve(
4545
legend_obs = "Observed data",
4646
legend_median = "Median prediction",
4747
show_quantiles = TRUE,
48-
log_scale = TRUE,
48+
log_y = TRUE,
4949
log_x = FALSE,
5050
show_all_curves = TRUE
5151
)
@@ -60,7 +60,7 @@ p3 <- plot_predicted_curve(
6060
legend_obs = "Observed data",
6161
legend_median = "Median prediction",
6262
show_quantiles = TRUE,
63-
log_scale = FALSE,
63+
log_y = FALSE,
6464
log_x = FALSE,
6565
show_all_curves = TRUE,
6666
xlim = c(0, 600)

man/plot_predicted_curve.Rd

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/test-plot_predicted_curve.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ test_that(
3030
legend_obs = "Observed data",
3131
legend_median = "Median prediction",
3232
show_quantiles = TRUE,
33-
log_scale = FALSE,
33+
log_y = FALSE,
3434
log_x = FALSE,
3535
show_all_curves = TRUE
3636
)
@@ -46,7 +46,7 @@ test_that(
4646
legend_obs = "Observed data",
4747
legend_median = "Median prediction",
4848
show_quantiles = TRUE,
49-
log_scale = TRUE,
49+
log_y = TRUE,
5050
log_x = FALSE,
5151
show_all_curves = TRUE
5252
)
@@ -62,7 +62,7 @@ test_that(
6262
legend_obs = "Observed data",
6363
legend_median = "Median prediction",
6464
show_quantiles = TRUE,
65-
log_scale = FALSE,
65+
log_y = FALSE,
6666
log_x = TRUE,
6767
show_all_curves = TRUE
6868
)
@@ -78,7 +78,7 @@ test_that(
7878
legend_obs = "Observed data",
7979
legend_median = "Median prediction",
8080
show_quantiles = TRUE,
81-
log_scale = FALSE,
81+
log_y = FALSE,
8282
log_x = FALSE,
8383
show_all_curves = TRUE,
8484
xlim = c(0, 500)

0 commit comments

Comments
 (0)