Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Hi, I can't test because I am using an old verion of tm (upgrading would break my code). Basically, you wan't to use your own custom function within tm_map. For that you need to encapsulate it within content_transformer. Cf for instance rstudio-pubs-static.s3.amazonaws.com/… and tm_transformerhelp. Now your function should be something like mytxtfoo <-content_transformer(function(txt){paste(mystemfunction(strsplit(txt, " ")[[1]]))})
It is difficult to answer without knowing anything about your problem, your objectives. So as for labelling, if it is about human labeling, you may be interested in Amazon Mechanical Turk --mturk.com/mturk/welcome
I would also add that if/when the character value itself (string) is of interest to you, for instance if you want to perform substring or regular expressions, you should consider text to avoir multiply calls to as.character().