1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-10 06:21:50 +02:00

(v2.1.1.9241) fix sir

This commit is contained in:
2025-04-18 13:25:59 +02:00
parent cf91e677c6
commit 579025f678
9 changed files with 143 additions and 89 deletions

View File

@ -244,11 +244,13 @@ create_scale_mic <- function(aest, keep_operators, mic_range = NULL, ...) {
}
scale$transform_df <- function(self, df) {
if (!aest %in% colnames(df)) {
# support for geom_hline() and geom_vline()
if ("yintercept" %in% colnames(df)) {
aest_val <- "yintercept"
} else if ("xintercept" %in% colnames(df)) {
aest_val <- "xintercept"
# support for geom_hline(), geom_vline(), etc
other_x <- c("xintercept", "xmin", "xmax", "xend", "width")
other_y <- c("yintercept", "ymin", "ymax", "yend", "height")
if (any(other_y %in% colnames(df))) {
aest_val <- intersect(other_y, colnames(df))[1]
} else if (any(other_x %in% colnames(df))) {
aest_val <- intersect(other_x, colnames(df))[1]
} else {
stop_("No support for plotting df with `scale_", aest, "_mic()` with columns ", vector_and(colnames(df), sort = FALSE))
}