简体   繁体   English

失败并发生错误:R 3.0.0之前已构建“包'sentiment':请重新安装”

[英]Failed with error: ‘package ‘sentiment’ was built before R 3.0.0: please re-install it’

I am trying to run the snaMIC.R script which is doing sentiment analysis on twitter data. 我正在尝试运行snaMIC.R脚本,该脚本正在对Twitter数据进行情感分析。 But it is failing with an error saying package sentiment was built before R 3.0.0: please re-install. 但是它失败并显示一条错误消息,指出软件包情感是在R 3.0.0之前构建的:请重新安装。 I am using R-3.1.0 i386 (32 bits win). 我正在使用R-3.1.0 i386(32位胜利)。 Another thing that I noted is that I am not getting the sentiment package under "Install packages". 我注意到的另一件事是,我没有在“安装软件包”下获得情感软件包。 I downloaded sentiment_0.2.zip file from http://cms.unipune.ernet.in/~webmaster/cran/bin/windows/contrib/2.14/sentiment_0.2.zip and unpacked it successfully under the default R win-library. 我从http://cms.unipune.ernet.in/~webmaster/cran/bin/windows/contrib/2.14/sentiment_0.2.zip下载了sentiment_0.2.zip文件,并在默认的R Win库下成功将其解压缩。 But the sentiment package is still not available under "Install packages". 但是,情感包在“安装包”下仍然不可用。 I added some more repositories but that did not help. 我添加了更多存储库,但这无济于事。 Any suggestions will be highly appreciated. 任何建议将不胜感激。

> source('snaMIC.R')
Loading required package: ROAuth
Loading required package: RCurl
Loading required package: bitops
Loading required package: digest
Loading required package: rjson
Loading required package: twitteR
Loading required package: stringr
Loading required package: ggplot2
Loading required package: grid
Loading required package: tm
Loading required package: NLP

Attaching package: ‘NLP’

The following object is masked from ‘package:ggplot2’:

    annotate

Loading required package: rJava

Attaching package: ‘rJava’

The following object is masked from ‘package:RCurl’:

    clone

Loading required package: Snowball
Installing package into ‘C:/Users/schakrabarti/Documents/R/win-library/3.1’
(as ‘lib’ is unspecified)
Loading required package: Snowball
Loading required package: wordcloud
Loading required package: Rcpp
Loading required package: RColorBrewer
Loading required package: topicmodels
Loading required package: slam
Loading required package: plyr

Attaching package: ‘plyr’

The following object is masked from ‘package:twitteR’:

    id

Loading required package: png
Loading required package: Snowball
Loading required package: sentiment
Failed with error:  ‘package ‘sentiment’ was built before R 3.0.0: please re-install it’
In addition: Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  there is no package called ‘Snowball’
2: package ‘Snowball’ is not available (for R version 3.1.0) 
3: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  there is no package called ‘Snowball’
4: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  there is no package called ‘Snowball’
Loading required package: Snowball
Loading required package: sentiment
Failed with error:  ‘package ‘sentiment’ was built before R 3.0.0: please re-install it’
In addition: Warning message:
In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  there is no package called ‘Snowball’
Loading required package: Snowball
Loading required package: sentiment
Failed with error:  ‘package ‘sentiment’ was built before R 3.0.0: please re-install it’
In addition: Warning message:
In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  there is no package called ‘Snowball’

First, I notice that URL actually offers to download RStem.zip, not sentiment_0.2.zip. 首先,我注意到URL实际上提供了下载RStem.zip的功能,而不是sendiment_0.2.zip。

I think what your error message would be more helpful saying is: you've downloaded a binary package for R 2.14, go and find the binary package for R 3.0 (or later) and download and install that instead. 我认为您的错误消息更有用的说法是:您已经下载了R 2.14的二进制软件包,然后找到R 3.0(或更高版本)的二进制软件包,然后下载并安装它。

Here are the 3.1 packages: http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/3.1/ 这是3.1程序包: http : //www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/3.1/

So perhaps you can try downloading and installing: http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/3.1/Rstem_0.4-1.zip 因此,也许您可​​以尝试下载并安装: http : //www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/3.1/Rstem_0.4-1.zip

If that doesn't work, you could try finding the source package and installing it that way. 如果那不起作用,您可以尝试查找源软件包并以这种方式安装。 But on Windows that might be non-trivial... 但是在Windows上可能并不简单...

I have come over the solution for above problem of "Failed with error: 'package 'sentiment' was built before R 3.0.0: please re-install it". 我已经解决了以上问题的解决方案:“失败,错误:'R'3.0.0之前已构建'package'sentiment':请重新安装它”。 Used the following sequence of commands from R console: 从R控制台使用了以下命令序列:

require(devtools)
install_url("http://cran.r-project.org/src/contrib/Archive/sentiment/sentiment_0.2.tar.gz")
require(sentiment)
ls("package:sentiment")

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 R中“错误:包'_____'是在3.0.0之前构建的:请重新安装”的原因 - Causes of “Error: package '_____' was built before 3.0.0: please re-install it” in R 错误:包'dmGWAS'是在R 3.0.0之前构建的:请重新安装它 - Error: package ‘dmGWAS’ was built before R 3.0.0: please re-install it 错误:“ggplot2”的包或命名空间加载失败:包“ggplot2”是在 R 4.0.0 之前安装的:请重新安装执行停止 - Error: package or namespace load failed for 'ggplot2': package 'ggplot2' was installed before R 4.0.0: please re-install it Execution halted R:“mxnet”的命名空间加载失败:package“mxnet”是在 R 4.0.0 之前安装的:请重新安装它 - R: namespace load failed for ‘mxnet’: package ‘mxnet’ was installed before R 4.0.0: please re-install it Package R 4.0.0之前安装了'XXX':请重新安装 - Package ‘XXX’ was installed before R 4.0.0: please re-install it 在 R 4.0.0 之前安装了包“xxx”:请重新安装(已经完成全新安装并检查了 lib 路径) - Package 'xxx’ was installed before R 4.0.0: please re-install it (already done fresh install and checked lib paths) Package 'stringr' 在 R 4.0.0 之前安装:请重新安装 BiocManager 安装路径不可写,无法更新软件包 - Package ‘stringr’ was installed before R 4.0.0: please re-install it BiocManager Installation path not writeable, unable to update packages 如何重新安装修改后的R程序包 - How to re-install a modified R package 在CentOS 6.5中使用共享库选项重新安装R - Re-Install R with Shared library option in CentOS 6.5 R install_github:错误:无法安装“未知包” - R install_github: Error: Failed to install 'unknown package'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM