Tazinho / snakecase

🐍🐍🐍 A systematic approach to parse strings and automate the conversion to snake_case, UpperCamelCase or any other case.
https://tazinho.github.io/snakecase/
GNU General Public License v3.0
147 stars 9 forks source link

case converters drop attributes #149

Closed strengejacke closed 6 years ago

strengejacke commented 6 years ago
library(snakecase)
strings <- c("this Is a Strange_string", "AND THIS ANOTHER_One")
names(strings) <- c("String A", "String B")
attr(strings, "test.attr") <- "test"
str(to_any_case(strings, case = "snake"))

#> Named chr [1:2] "this_is_a_strange_string" "and_this_another_one"
#> - attr(*, "names")= chr [1:2] "String A" "String B"

Would be nice if all attributes are copied along and returned with the converted vector, so desired result would be:

 Named chr [1:2] "this Is a Strange_string" "AND THIS ANOTHER_One"
 - attr(*, "names")= chr [1:2] "String A" "String B"
 - attr(*, "test.attr")= chr "test"
Tazinho commented 6 years ago

Thanks for the input, Daniel.

strengejacke commented 6 years ago

Do you have a roadmap in mind and can say when you will update your pkg on CRAN? Background is that I currently use a workaround for this issue, which is no longer needed once this update is on CRAN.

Tazinho commented 6 years ago

Just submitted ten minutes ago :D