We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
is.ggtrace_placeholder()
library(ggplot2) ggplot(mtcars, aes(mpg, hp)) + geom_point(aes(color = as.factor(cyl)))
library(ggtrace) l <- ggtrace_inspect_return(last_plot(), ggplot2:::guide_gengrob.legend, cond = 1) #> Warning in .is_traced(what, where) || is.ggtrace_placeholder(._return): #> 'length(x) = 4 > 1' in coercion to 'logical(1)' l #> TableGrob (7 x 6) "layout": 11 grobs #> z cells name grob #> 1 1 (1-7,1-6) background rect[legend.background..rect.120] #> 2 2 (2-2,2-5) title gTree[GRID.gTree.121] #> 3 3 (4-4,2-2) key-3-1-bg rect[legend.key..rect.111] #> 4 4 (4-4,2-2) key-3-1-1 points[GRID.points.112] #> 5 5 (5-5,2-2) key-4-1-bg rect[legend.key..rect.114] #> 6 6 (5-5,2-2) key-4-1-1 points[GRID.points.115] #> 7 7 (6-6,2-2) key-5-1-bg rect[legend.key..rect.117] #> 8 8 (6-6,2-2) key-5-1-1 points[GRID.points.118] #> 9 9 (4-4,4-4) label-3-3 gTree[GRID.gTree.122] #> 10 10 (5-5,4-4) label-4-3 gTree[GRID.gTree.123] #> 11 11 (6-6,4-4) label-5-3 gTree[GRID.gTree.124] ggtrace::ggdraw_silent(l)
Created on 2022-12-06 with reprex v2.0.2
Ugh I'm dumb:
ggtrace:::is.ggtrace_placeholder #> function (x) #> class(x) == "ggtrace_placeholder" #> <bytecode: 0x000001a9977850e0> #> <environment: namespace:ggtrace> ggtrace:::is.ggtrace_placeholder(l) #> [1] FALSE FALSE FALSE FALSE
Should I use is()? That requires import from {methods} but it's stdlib so should be ok...
is()
{methods}
is(l, "ggtrace_placeholder") #> [1] FALSE is(ggtrace:::.ggtrace_placeholder, "ggtrace_placeholder") #> [1] TRUE
The text was updated successfully, but these errors were encountered:
49549e4
No branches or pull requests
Reprex
Created on 2022-12-06 with reprex v2.0.2
Problem
Ugh I'm dumb:
Should I use
is()
? That requires import from{methods}
but it's stdlib so should be ok...The text was updated successfully, but these errors were encountered: