SCM

SCM Repository

[tm] View of /pkg/R/filter.R
ViewVC logotype

View of /pkg/R/filter.R

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1445 - (download) (annotate)
Sun Oct 9 09:30:58 2016 UTC (2 years, 4 months ago) by feinerer
File size: 411 byte(s)
Speed up termFreq(), general cleanup

- Avoid parallel::mclapply()
- Use custom .table()
- Use rep.int(), rep_len() and lengths()
- Fix typos
- Shorten overlong lines
- Consistent formatting
# Author: Ingo Feinerer
# Filters

tm_filter <-
function(x, FUN, ...)
    UseMethod("tm_filter", x)
tm_filter.PCorpus <-
tm_filter.SimpleCorpus <-
tm_filter.VCorpus <-
function(x, FUN, ...)
    x[tm_index(x, FUN, ...)]

tm_index <-
function(x, FUN, ...)
    UseMethod("tm_index", x)
tm_index.PCorpus <-
tm_index.SimpleCorpus <-
tm_index.VCorpus <-
function(x, FUN, ...)
    unlist(lapply(content(x), FUN, ...))

R-Forge@R-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business University of Wisconsin - Madison Powered By FusionForge