![](/img/trans.png)
[英]Causes of “Error: package '_____' was built before 3.0.0: please re-install it” in R
[英]Failed with error: ‘package ‘sentiment’ was built before R 3.0.0: please re-install it’
我正在尝试运行snaMIC.R脚本,该脚本正在对Twitter数据进行情感分析。 但是它失败并显示一条错误消息,指出软件包情感是在R 3.0.0之前构建的:请重新安装。 我正在使用R-3.1.0 i386(32位胜利)。 我注意到的另一件事是,我没有在“安装软件包”下获得情感软件包。 我从http://cms.unipune.ernet.in/~webmaster/cran/bin/windows/contrib/2.14/sentiment_0.2.zip下载了sentiment_0.2.zip文件,并在默认的R Win库下成功将其解压缩。 但是,情感包在“安装包”下仍然不可用。 我添加了更多存储库,但这无济于事。 任何建议将不胜感激。
> 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’
首先,我注意到URL实际上提供了下载RStem.zip的功能,而不是sendiment_0.2.zip。
我认为您的错误消息更有用的说法是:您已经下载了R 2.14的二进制软件包,然后找到R 3.0(或更高版本)的二进制软件包,然后下载并安装它。
这是3.1程序包: http : //www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/3.1/
因此,也许您可以尝试下载并安装: http : //www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/3.1/Rstem_0.4-1.zip
如果那不起作用,您可以尝试查找源软件包并以这种方式安装。 但是在Windows上可能并不简单...
我已经解决了以上问题的解决方案:“失败,错误:'R'3.0.0之前已构建'package'sentiment':请重新安装它”。 从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.