How to convert CamelCase to not.camel.case in R

后端 未结 3 1363
鱼传尺愫
鱼传尺愫 2020-12-16 21:32

In R, I\'d like to convert

c(\"ThisText\", \"NextText\")

to

c(\"this.text\", \"next.text\")

This is the r

3条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-16 22:11

    You could do this also via the snakecase package:

    install.packages("snakecase")
    library(snakecase)
    
    to_snake_case(c("ThisText", "NextText"), sep_out = ".")
    # [1] "this.text" "next.text"
    

    Github link to package: https://github.com/Tazinho/snakecase

提交回复
热议问题