trinker / qdap

Quantitative Discourse Analysis Package: Bridging the gap between qualitative data and quantitative analysis
http://cran.us.r-project.org/web/packages/qdap/index.html
175 stars 44 forks source link

In `replace_number()`, coerce input text to character vector, to prevent surprises with numeric vector inputs #236

Closed bschneidr closed 7 years ago

bschneidr commented 7 years ago

This should be harmless for the large majority of the time when someone inputs a character vector, but should prevent issues that arise when the input is a numeric vector.

As an illustration of the issues with a numeric vector input, compare replace_number(999999) and replace_number("999999"), which both return what you'd expect, to replace_number(1000000) and replace_number("1000000"), which give different results.

trinker commented 7 years ago

Thanks for the PR!

bschneidr commented 7 years ago

Thanks for the excellent package!