Re: [R] Need content_transformer() called by tm_map() to change non-letters to spaces
Regex "[^a-zA-Z]" reads as "not a letter". --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#. Live Go... Live: OO#.. D
[R] Need content_transformer() called by tm_map() to change non-letters to spaces
Hello, In the following code, any characters matching "/|@| \\|") will be changed to a space. > library(tm) > toSpace <- content_transformer(function(x, pattern) gsub(pattern, " ", x)) > docs <- tm_map(docs, toSpace, "/|@| \\|") What code would transform all non-letters to a space? (What goes