2017-09-12 58 views
2

这是我第一次尝试在R中安装和加载tm软件包,至此我失败了。这里是我的机器信息:无法在R中加载'tm'软件包

> sessionInfo() 
R version 3.4.0 (2017-04-21) 
Platform: x86_64-w64-mingw32/x64 (64-bit) 
Running under: Windows >= 8 x64 (build 9200) 

Matrix products: default 

locale: 
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252 
[4] LC_NUMERIC=C       LC_TIME=English_United States.1252  

attached base packages: 
[1] stats  graphics grDevices utils  datasets methods base  

other attached packages: 
[1] RevoUtilsMath_10.0.0 

loaded via a namespace (and not attached): 
[1] compiler_3.4.0 RevoUtils_10.0.4 tools_3.4.0 

我做的安装运行下面的代码:

install.packages('tm', repos = 'https://cran.r-project.org', dependencies = T) 

这给我下面的消息:

Warning in install.packages : 
dependencies ‘Rcampdf’, ‘Rgraphviz’, ‘Rpoppler’, ‘tm.lexicon.GeneralInquirer’ are not available 
also installing the dependencies ‘NLP’, ‘Rcpp’, ‘slam’, ‘BH’, ‘filehash’, ‘SnowballC’, ‘XML’ 
... 
... 
package ‘NLP’ successfully unpacked and MD5 sums checked 
package ‘Rcpp’ successfully unpacked and MD5 sums checked 
package ‘slam’ successfully unpacked and MD5 sums checked 
package ‘BH’ successfully unpacked and MD5 sums checked 
package ‘filehash’ successfully unpacked and MD5 sums checked 
package ‘SnowballC’ successfully unpacked and MD5 sums checked 
package ‘XML’ successfully unpacked and MD5 sums checked 
package ‘tm’ successfully unpacked and MD5 sums checked 

但是当我尝试加载它给我的包如下错误:

load('tm') 
Error in readChar(con, 5L, useBytes = TRUE) : cannot open the connection 
In addition: Warning message: 
In readChar(con, 5L, useBytes = TRUE) : 
    cannot open compressed file 'tm', probable reason 'No such file or directory' 

感谢任何帮助/智慧的话

+5

加载库,类型:'库(TM)' –

回答

1

load()函数重新加载以前保存的数据集。

您正在寻找library()函数,正如@Marco Sandri在评论中指出的那样。

尝试:

library(tm)