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

Quote variable names when reporting on repair #407

Closed
jennybc opened this Issue May 2, 2018 · 3 comments

Comments

Projects
None yet
3 participants
@jennybc
Copy link
Member

jennybc commented May 2, 2018

When set_tidy_names() reports names affected by repair, they should be quoted in the message.

tibble::tidy_names(c("a", "", "b", "a"))
#> New names:
#> a -> a..1
#>  -> ..2
#> a -> a..4
#> [1] "a..1" "..2"  "b"    "a..4"

Created on 2018-05-02 by the reprex package (v0.2.0).

Written quickly as an aside during a meeting with @hadley, now fleshed out a bit. Let me know if I/we should expand.

@jennybc jennybc changed the title Quote the new names Quote variable names when reporting on repair May 2, 2018

@krlmlr

This comment has been minimized.

Copy link
Member

krlmlr commented Jun 6, 2018

Thanks. Do we need to quote all names, or only non-syntactic ones?

@hadley

This comment has been minimized.

Copy link
Member

hadley commented Aug 2, 2018

Also need to display NAs

tibble::tidy_names(c("", NA))
#> New names:
#>  -> ..1
#>  -> ..2
#> [1] "..1" "..2"

And in general, needs to encode strings:

tibble::tidy_names(c("\n", "\n"))
#> New names:
#> 
#>  -> 
#> ..1
#> 
#>  -> 
#> ..2
#> [1] "\n..1" "\n..2"

@krlmlr krlmlr closed this in 657bc65 Aug 16, 2018

@krlmlr

This comment has been minimized.

Copy link
Member

krlmlr commented Aug 16, 2018

Will add tests as part of #406.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment