Skip to content

set_tidy_names fails when wanting syntactic names #260

Closed

Description

@imanuelcostigan

Reprex:

library(tibble)
packageVersion("tibble")
#> [1] '1.3.1'
tbl <- tibble(`a name` = 1, b = 2)
set_tidy_names(tbl, syntactic = TRUE)
#> Error: length(orig_name) == length(name) is not TRUE

Analysis: make_syntactic() is not returning the parsed set of field names. Input name is [1] "a name" "b" while last line of this function is assignment of parsed field names rather than full set of field names and hence returns only subset of field names that have been tidied:

function (name, syntactic) 
{
  if (!syntactic) 
    return(name)
  blank <- name == ""
  fix_syntactic <- (name != "") & !is_syntactic(name)
  name[fix_syntactic] <- make.names(name[fix_syntactic])
}

Activity

  1. changed the title [-]tidy_names fails when wanting syntactic names[/-] [+]set_tidy_names fails when wanting syntactic names[/+] on May 23, 2017
  2. added 4 commits that reference this issue on May 23, 2017
  3. github-actions commented on Dec 13, 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.

  4. locked and limited conversation to collaborators on Dec 13, 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