-
Notifications
You must be signed in to change notification settings - Fork 25
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
Add check_aes() for gplot2 aesthetics #190
Labels
Comments
@richierocks I currently do not have time for this, but feel free to add this utility function in |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm just starting to go through the ggplot2 courses updating SCTs to not use
test_ggplot()
.For a simple plot like this:
I'm writing SCTs like this:
So far, the most unsatisfying part is checking the aesthetics, since you always have to do
eval = FALSE
.ggplot2
v3 is built on top ofrlang
, so I can now doThis is great because I can check the object (and
rlang
is always installed in the image becauseggplot2
imports it).There are 2 small problems:
I think these problems can be nicely solved by having a
check_aes()
that wraps this functionality.Something like
One bigger problem is that it requires that the student assign the plot to a variable. I thought I could use
last_plot()
to retrieve the last plot that the students drew, but evaluation of that plot fails.last_plot()
effectively doesasNamespace("ggplot2")$.store$get()
, and I've no idea howtestwhat
tries to evaluate that.The text was updated successfully, but these errors were encountered: