Post Body:
Hi everyone,
I’m running into an unexpected error when using sec_axis()
with ggplot2
. I’ve checked the documentation and previous posts, and I couldn’t find anything that explains this behavior. So I’m wondering if anyone else has experienced something similar, or if I might be missing something obvious.
Here’s a minimal reproducible example:
library(ggplot2)
df <- data.frame(x = 1:10, y = (1:10) * 2)
ggplot(df, aes(x = x, y = y)) +
geom_line() +
scale_y_continuous(
name = "Primary Axis",
sec.axis = sec_axis(~ . / 2, name = "Secondary Axis")
)
This gives me the following error:
r
CopiarEditar
Error in train_continuous(x, self$range, call = call) :
unused argument (call = call)
I’m using ggplot2
version 3.5.2, freshly installed from CRAN. I’ve also restarted my R session and reinstalled the package, but the error still occurs.
Has anyone seen this before? Any insights would be appreciated!
Thanks in advance.