Skip to content

fix a typo in NEWS.md #2661

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

Merged
merged 2 commits into from
Jun 25, 2018
Merged

fix a typo in NEWS.md #2661

merged 2 commits into from
Jun 25, 2018

Conversation

yutannihilation
Copy link
Member

No description provided.

@clauswilke
Copy link
Member

The typo fix looks good to me.

However, (probably more a comment to @hadley), I don't understand the following phrase:
"use quo_name() (for shorter labels) or quo_text() (if you want everything)."

Even after reading the documentation for quo_name() and quo_text() I don't know what this means. Specifically, I'm wondering, what is a "short" label (where I'd use quo_name()) and what is "everything"? Can we rephrase this?

@yutannihilation
Copy link
Member Author

Yeah, I too felt the phase mysterious, but I found what a "short" label is in ?quo_label():

# quo_name() is helpful when you need really short labels:
quo_name(quo(sym))
#> [1] "sym"
quo_name(quo(!! sym))
#> [1] "function (x) ..."

I'm still not sure about the actual use cases, but maybe this is useful when you create a label by deparsing an aes that is not a simple symbol and contains unquoted functions in its expression?

@clauswilke
Copy link
Member

clauswilke commented May 28, 2018

I think talking about "short" symbols is misleading:

quo_name(quo(this_is_a_really_long_symbol_and_quo_name_has_no_problem_with_it))
#> [1] "this_is_a_really_long_symbol_and_quo_name_has_no_problem_with_it"
quo_text(quo(this_is_a_really_long_symbol_and_quo_name_has_no_problem_with_it))
#> [1] "this_is_a_really_long_symbol_and_quo_name_has_no_problem_with_it"

quo_name() and quo_text() seem to return the same result for symbols but different results for expressions. For expressions, at some point quo_name() starts to abbreviate but quo_text() keeps going:

quo_name(quo(a + b + c + d + e + f + g + h + i + j + k + l + m + n + o + p))
#> [1] "a + b + c + d + e + f + g + h + i + j + k + l + m + n + o + p"
quo_name(quo(a + b + c + d + e + f + g + h + i + j + k + l + m + n + o + p + q))
#> [1] "+..."
quo_text(quo(a + b + c + d + e + f + g + h + i + j + k + l + m + n + o + p + q))
#> [1] "a + b + c + d + e + f + g + h + i + j + k + l + m + n + o + p + \n    q"

@hadley
Copy link
Member

hadley commented May 28, 2018

Yeah, it's long expressions that are shortened, not long symbols. We need to document this better in rlang; I think it's ok if it's slightly bewildering in the NEWS file — at least it gets people looking in the right direction (although better wording is, of course, appreciated)

@clauswilke
Copy link
Member

How about:

use quo_name() (to generate single-line strings; longer expressions may be abbreviated) or quo_text() (to generate non-abbreviated strings that may span multiple lines)

@hadley
Copy link
Member

hadley commented May 28, 2018

👍

@yutannihilation
Copy link
Member Author

@clauswilke Thanks for the nice sentence! Should I include this? If you will create another PR, I'll close this here.

@clauswilke
Copy link
Member

Yes, just include it in your PR. Thanks!

@yutannihilation
Copy link
Member Author

Sure!

@yutannihilation
Copy link
Member Author

Done.

@hadley hadley merged commit 78d4b7a into tidyverse:master Jun 25, 2018
@hadley
Copy link
Member

hadley commented Jun 25, 2018

Thanks!

@yutannihilation yutannihilation deleted the patch-2 branch June 25, 2018 21:07
@lock
Copy link

lock bot commented Dec 22, 2018

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Dec 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants