Is there an alternative to “revalue” function from plyr when using dplyr?

后端 未结 4 1101
野性不改
野性不改 2021-02-18 16:05

I\'m a fan of the revalue function is plyr for substituting strings. It\'s simple and easy to remember.

However, I\'ve migrated new code to

4条回答
  •  一向
    一向 (楼主)
    2021-02-18 16:53

    We can do this with chartr from base R

    chartr("ac", "AC", x)
    

    data

    x <- c("a", "b", "c")
    

提交回复
热议问题