Advertisement
Guest User

Untitled

a guest
May 2nd, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. docs <- Corpus(DirSource("path of the directory containing text documents"))
  2. f <- content_transformer(function(x, pattern)regmatches(x, gregexpr(pattern, x, ignore.case=TRUE)))
  3. genes = "IL1|IL2|IL3|IL4|IL5|IL6|IL7|IL8|IL9|IL10|TNF|TGF|AP2|OLR1|OLR2"
  4. docs <- tm_map(docs, f, genes)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement