Description Usage Arguments Value See Also Examples
Make names nicer to work with
1 |
x |
A character vector of names |
A transformed version of those names
make.names()
and tibble::tibble()
's .name_repair
argument
Resulting names are guaranteed to be unique, and will almost certainly be syntactic.
1 2 3 4 5 6 7 8 | make_better_names(c("Country", "GDP $M", "Coast.Length"))
#> [1] "country" "gdp_mn" "coast_length"
# Note that the guarantee to make the names unique can lead to some surprises
# for example, "a_and_b" becomes "a_and_b_3" in this case:
make_better_names(c("a and b", "a-and-b", "a.and.b", "a_and_b"))
#> c("a_and_b", "a_and_b_1", "a_and_b_2", "a_and_b_3")
# Here's a way to have a bad time:
make_better_names(c("", "x", "X", "x_1"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.