Skip to content
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

Only RHS-formula accepted as lambda function #6385

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

teunbrand
Copy link
Collaborator

Thsi PR aims to fix #6384 and amends #6200.

Briefly, the reason bquote() input for scale names wasn't accepted is because it was interpreted as a two-sided formula.
This PR only attempts to cast a RHS-only formula as a function.

Reprex from issue:

devtools::load_all("~/packages/ggplot2")
#> ℹ Loading ggplot2

eff <- "Efficiency"
ggplot(mtcars, aes(factor(cyl), mpg)) + 
  geom_boxplot() + 
  scale_y_continuous(name = bquote(.(eff)~(mi~gl^{-1})))

Created on 2025-03-28 with reprex v2.1.1

@teunbrand teunbrand changed the title Lambda bquote Only RHS-formula accepted as lambda Mar 28, 2025
@teunbrand teunbrand changed the title Only RHS-formula accepted as lambda Only RHS-formula accepted as lambda function Mar 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Some values returned by bquote() trigger errors (3.5.1.9000)
1 participant