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

partial match (vp$just --> 'justification') #5851

Closed
MichaelChirico opened this issue Apr 21, 2024 · 2 comments
Closed

partial match (vp$just --> 'justification') #5851

MichaelChirico opened this issue Apr 21, 2024 · 2 comments

Comments

@MichaelChirico
Copy link
Contributor

The reprex here uses {hexbin}, but I think the error is arising from {ggplot2}, just that I haven't come up with another example.

library(hexbin)
library(ggplot2)
options(warnPartialMatchDollar=TRUE)

DF=data.frame( a=1:5, b=11:50, d=c("A","B","C","D"), f=1:5, grp=1:5 )
p=ggplot(DF) + geom_hex(aes(b, f))
print(p)
# Warning message:
# In vp$just : partial match of 'just' to 'justification'

Unfortunately options(warn=2) then browser() doesn't yield a traceback, so I'm not sure how to proceed.

  • {hexbin} itself only uses just in calls to grid::viewport(), and indeed "just" %in% names(formals(grid::viewport))
  • {ggplot2} has many more matches to just; stepping through print.ggplot, the error happens at this line:

gtable <- ggplot_gtable(data)

And then:

legend_box <- plot$guides$assemble(theme)

but I can't debug that call to plot$guides$assemble.

  • Searching CRAN generally we do get this match in {gtable}:

https://github.com/search?q=org%3Acran+lang%3AR+%2Fvp%5B%24%5Djust%5B%5Ei%5D%2F&type=code

As well as this match in {grid} itself:

https://github.com/r-devel/r-svn/blob/125ad32d2f936092815062366733b30b1a87d39f/src/library/grid/R/viewport.R#L472

(but debugging editViewport() doesn't pick up any calls)

Any ideas where this error might be coming from?

@teunbrand
Copy link
Collaborator

Hi there, thanks for the report! Is this by any chance the same as #5654? If so, there is already a PR pending in {gtable}: r-lib/gtable#94

@MichaelChirico
Copy link
Contributor Author

100%, great news!

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

No branches or pull requests

2 participants