poissonconsulting / tidyplus

An R package of additional tidyverse functions
https://poissonconsulting.github.io/tidyplus/
Other
9 stars 0 forks source link

Str replace when function #16

Closed nadinehussein closed 4 months ago

nadinehussein commented 1 year ago

closes #15

nadinehussein commented 1 year ago

Looks great - can you add tests for more edge cases like x of no length and replace of no length. Also you only need to use mutate for one test that it works with mutate. You can just use a straight vector without it being a column of a dataset for the rest. Also in the documentation you can just can be used to replace multiple strings in a vector.

tests have been changed and description was updated - I wanted to mention the difference between the function and str_replace_all because we don't need to create a str_replace_all version of str_replace_vec since str_replace_all can already do vectorized forms.