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

Extra step needed in enquo example? #4

Closed
gvwilson opened this issue Nov 20, 2018 · 5 comments
Closed

Extra step needed in enquo example? #4

gvwilson opened this issue Nov 20, 2018 · 5 comments

Comments

@gvwilson
Copy link

The last exercise in the "Quosures" section of https://ijlyttle.shinyapps.io/tidyeval/#section-writing-functions-that-use-tidyeval tells me to uncomment an expression that assigns "birth_year" to input_name and then change a function call, presumably so that the variable input_name is passed into filter_sym_value. However, doing this results in a tibble with zero rows rather than the same tibble produced by the original code. Have I misunderstood the instructions?
screen shot 2018-11-20 at 12 23 04 pm

@ijlyttle
Copy link
Owner

ijlyttle commented Nov 20, 2018

Thanks!

I will take it as an action item for me to update the exercise to supply a hint (it took me a couple minutes to wrap my head around this again).

In essence, like earlier in the tutorial, the function argument input_sym is expecting a symbol. As such, my approach would be to convert input_name to a symbol, then evaluate it right away.

Answer
filter_sym_value(starwars, !!sym(input_name), 19)

@ijlyttle
Copy link
Owner

The phrase "so that it uses input_name" should be improved to suggest that it will involve more than replacement.

@gvwilson
Copy link
Author

Thanks - I eventually figured out it had to be something like that. This is a really strong tutorial - thank you for creating it.

@ijlyttle
Copy link
Owner

My pleasure!

@ijlyttle ijlyttle mentioned this issue Sep 19, 2021
@ijlyttle
Copy link
Owner

Hi Greg - just to note that I have made a new version of the tutorial - aimed at the practical aspects of tidy evaluation, so this issues has been obviated.

Thanks again for your input - when I re-do a more-advanced version, I'll check back in with this issue!

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