【问题标题】:unable to find content_transformer in tm [closed]无法在 tm 中找到 content_transformer [关闭]
【发布时间】:2016-10-20 01:28:13
【问题描述】:

是否从 tm 包 0.6-2 中删除了 content_transformer 函数??

library(tm)
docs<-Corpus(DirSource("Dname"))
docs<-tm_map(docs,content_transformer(gsub), pattern="using",replacement="use")
Error: could not find function "content_transformer" 

【问题讨论】:

    标签: r data-mining tm text-analysis


    【解决方案1】:

    您可能需要更新软件包。 This GitHub repository表示函数导出,也是present in the code

    > library(tm)
    Loading required package: NLP
    > content_transformer
    function (FUN) 
    function(x, ...) {
        content(x) <- FUN(content(x), ...)
        x
    }
    <environment: namespace:tm>
    
    > sessionInfo()
    R version 3.2.3 (2015-12-10)
    Platform: x86_64-w64-mingw32/x64 (64-bit)
    Running under: Windows >= 8 x64 (build 9200)
    
    locale:
    [1] LC_COLLATE=Slovenian_Slovenia.1250  LC_CTYPE=Slovenian_Slovenia.1250    LC_MONETARY=Slovenian_Slovenia.1250
    [4] LC_NUMERIC=C                        LC_TIME=Slovenian_Slovenia.1250    
    
    attached base packages:
    [1] stats     graphics  grDevices utils     datasets  methods   base     
    
    other attached packages:
    [1] tm_0.6-2  NLP_0.1-9
    
    loaded via a namespace (and not attached):
    [1] rsconnect_0.4.1.4 parallel_3.2.3    tools_3.2.3       slam_0.1-35 
    

    【讨论】:

      猜你喜欢
      • 2017-12-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-19
      • 2021-08-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多