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])
}
Reprex:
Analysis:
make_syntactic()is not returning the parsed set of field names. Inputnameis[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: