Skip to content

Quote variable names when reporting on repair #407

Closed

Description

@jennybc

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.

Activity

  1. changed the title [-]Quote the new names[/-] [+]Quote variable names when reporting on repair[/+] on May 2, 2018
  2. krlmlr commented on Jun 6, 2018

    @krlmlr
    Member

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

  3. hadley commented on Aug 2, 2018

    @hadley
    Member

    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"
  4. krlmlr commented on Aug 16, 2018

    @krlmlr
    Member

    Will add tests as part of #406.

  5. github-actions commented on Dec 10, 2020

    @github-actions
    Contributor

    This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.

  6. locked and limited conversation to collaborators on Dec 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions