-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
scales::rescale*
functions cannot use \(x) x
notation
#388
Comments
library(tidyverse)
#this also doesn't work using function(x) notation
ggplot(mpg, aes(displ, hwy, colour = cty - mean(cty))) +
geom_point() +
labs(
x = "Engine displacement [L]",
y = "Highway miles per gallon",
colour = "Centered\nvalue"
) +
scale_colour_stepsn(
colours = c("blue", "white", "red"),
rescaler = function(x) scales::rescale_mid(x, mid = 0),
breaks = scales::breaks_width(5),
)
#> Error in rescaler(...): unused argument (from = c(-7.85897435897436, 18.1410256410256)) Created on 2023-06-18 with reprex v2.0.2 |
The reason |
davidhodge931
changed the title
scales::rescale* functions cannot use \(x) x notation
Jul 22, 2023
scales::rescale*
functions cannot use \(x) x
notation
Yeah, this is nothing to do with anonymous function syntax and everything to do with expected arguments. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I assume this is an error with
scales::rescale*
functions and not ggplot2.Created on 2023-06-18 with reprex v2.0.2
The text was updated successfully, but these errors were encountered: