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
Error with enquo: the argument has already been evaluated #300
Comments
Already fixed in branch #297, duplicate of #295. Note that while you won't get an error, you will capture the evaluated argument rather than its expression. This is not good for labelling. The mechanism for capture is tied to lazy evaluation so if you force an argument it is no longer possible to capture it. In this case the argument has been forced because it needs to be evaluated in order to see what class it has and dispatch appropriately. If you just want a label, you don't need quosures anyway so you can just use @hadley I wonder if we need |
thanks, |
@lionel- hmmmm interesting thought. Maybe create an issue to discuss? (There are two scenarios: where you need quasiquotation for some other purpose, and where you don't) |
This is now fixed on master. |
I am trying to use
enquo
in asummary()
generic function. I'm having some trouble reproducing this - I know this is a red flag - but perhaps there is something missing about how I understand how this function works that someone can address.A function in a package I'm developing outputs a list such as the following list, with three elements, the first a
tibble
, and the second and thirdggplot2
plot objects:My goal is to use the name of the object as a string; I'm trying to use a function like the following to walk people through how to print each of the three list elements, but this fails on the 1st line - with
rlang::enquo(x)
:When I run summary, as in
summary(x)
, the error is:It does not seem to me that the argument is evaluated until the
length()
function on the function's 7th line. Can you help me to understand why I cannot use rlang::enquo() on the name of the object passed tosummary()
?There are a number of Stack Overflow questions on this topic (here, here, and here), but their answers were either inconclusive or did not seem pertinent in this case.
The text was updated successfully, but these errors were encountered: