trinker/textclean

Allow piping

tspeidel opened this issue · 2 comments

Great package! Any chance you can support piping and make it more tidy compliant?
e.g.

library(textclean)
library(dplyr)

x <- c("i like", "<p>i want. </p>. thet them ther .", "I am ! that|", "", NA, 
    "&quot;they&quot; they,were there", ".", "   ", "?", "3;", "I like goud eggs!", 
    "bi\xdfchen Z\xfcrcher", "i 4like...", "\\tgreat",  "She said \"yes\"")

x <- as.data.frame(x)

x <- x %>%
  rename(text = x) %>%
  strip(text, char.keep = c("?", ".")) %>%
  replace_non_ascii(text) %>%
  replace_symbol(text)
Error in as.logical(test) : 
  cannot coerce type 'closure' to vector of type 'logical'

I'm sorry, it does work.