I've just start learning R. I'm using an example, going through the steps and everything is working so far except for this method below:
words <- dtm %>%
(function(x) x[nchar(x) < 20])
Error: could not find function "%>%"
You need to install the package
magrittr first, then it should work.
The pipe operator
%>% was introduced to "decrease development time and to improve readability and maintainability of code."
But everybody has to decide for himself if it really fits his workflow and makes things easier.
For more information on
magrittr, click here.
Not using the pipe
%>%>, this code would return the same as your code:
words <- colnames(as.matrix(dtm)) words <- words[nchar(words) < 20] words