簡體   English   中英

失敗並發生錯誤:R 3.0.0之前已構建“包'sentiment':請重新安裝”

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM