Skip to content

sec_axis() triggers train_continuous() error with unused argument call = call on ggplot2 3.5.2 #6502

Closed
@joaopedrosusselbertogna

Description

Hi,

I’m encountering an unexpected error when trying to use sec_axis() in a simple plot. I’ve checked the documentation and some previous issues, and I haven’t found anything that would suggest a mistake in the code below. That’s why I’m wondering if it might be a bug.

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")
)

Error message:

Error in train_continuous(x, self$range, call = call) :
argumento não utilizado (call = call)

What I’ve tried:
I updated ggplot2 using install.packages("ggplot2")

Restarted the R session

Removed and reinstalled the package

Verified I’m using version 3.5.2

Still, the error persists. I understand this could be due to something specific in my R setup, but since the example is minimal and uses only base R + ggplot2, I thought it was worth reporting in case others are affected.

Thanks in advance for your time and for all the work you do on the package!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions