2016-03-09 58 views
2

我最初使用下載的data.table包從CRAN:麻煩下載{} data.table包

install.packages() 

它下載版本1.9.4,打了幾個減速帶,並打算通過這個網站,我想通後我不得不從github下載最新版本。爲了做到這一點,我試圖下載到「devtools」,但我沒有成功。以下是我得到的錯誤:

* installing *source* package ‘curl’ ... 
** package ‘curl’ successfully unpacked and MD5 sums checked 
Package libcurl was not found in the pkg-config search path. 
Perhaps you should add the directory containing `libcurl.pc' 
to the PKG_CONFIG_PATH environment variable 
No package 'libcurl' found 
Package libcurl was not found in the pkg-config search path. 
Perhaps you should add the directory containing `libcurl.pc' 
to the PKG_CONFIG_PATH environment variable 
No package 'libcurl' found 
Using PKG_CFLAGS= 
Using PKG_LIBS=-lcurl 
------------------------- ANTICONF ERROR --------------------------- 
Configuration failed because libcurl was not found. Try installing: 
* deb: libcurl4-openssl-dev (Debian, Ubuntu, etc) 
* rpm: libcurl-devel (Fedora, CentOS, RHEL) 
* csw: libcurl_dev (Solaris) 
If libcurl is already installed, check that 'pkg-config' is in your 
PATH and PKG_CONFIG_PATH contains a libcurl.pc file. If pkg-config 
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via: 
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...' 
-------------------------------------------------------------------- 
ERROR: configuration failed for package ‘curl’ 
* removing ‘/home/trader/R/x86_64-pc-linux-gnu-library/3.2/curl’ 
Warning in install.packages : 
    installation of package ‘curl’ had non-zero exit status 
* installing *source* package ‘RCurl’ ... 
** package ‘RCurl’ successfully unpacked and MD5 sums checked 
checking for curl-config... no 
Cannot find curl-config 
ERROR: configuration failed for package ‘RCurl’ 
* removing ‘/home/trader/R/x86_64-pc-linux-gnu-library/3.2/RCurl’ 
Warning in install.packages : 
    installation of package ‘RCurl’ had non-zero exit status 
ERROR: dependency ‘curl’ is not available for package ‘httr’ 
* removing ‘/home/trader/R/x86_64-pc-linux-gnu-library/3.2/httr’ 
Warning in install.packages : 
    installation of package ‘httr’ had non-zero exit status 
ERROR: dependency ‘curl’ is not available for package ‘rversions’ 
* removing ‘/home/trader/R/x86_64-pc-linux-gnu-library/3.2/rversions’ 
Warning in install.packages : 
    installation of package ‘rversions’ had non-zero exit status 
ERROR: dependencies ‘httr’, ‘RCurl’, ‘rversions’ are not available for package ‘devtools’ 
* removing ‘/home/trader/R/x86_64-pc-linux-gnu-library/3.2/devtools’ 
Warning in install.packages : 
    installation of package ‘devtools’ had non-zero exit status 

The downloaded source packages are in 
    ‘/tmp/RtmpMtxhRg/downloaded_packages’ 

所以,我想另一種方法,並從https://cran.r-project.org/web/packages/data.table/index.html下載.tar.gz文件。

然後使用:

> install.packages("~/Downloads/data.table_1.9.6.tar.gz", repos = NULL, type = "source") 

下載成功,但我得到了下面的錯誤嘗試加載它的時候:

> library("data.table", lib.loc="~/R/x86_64-pc-linux-gnu-library/3.2") 
data.table 1.9.6 For help type ?data.table or https://github.com/Rdatatable/data.table/wiki 
The fastest way to learn (by data.table authors): https://www.datacamp.com/courses/data-analysis-the-data-table-way 

Attaching package: ‘data.table’ 

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

    last 

Error in fetch(key) : 
    lazy-load database '/home/trader/R/x86_64-pc-linux-gnu-library/3.2/data.table/help/data.table.rdb' is corrupt 
In addition: Warning message: 
In fetch(key) : internal error -3 in R_decompress1 

我的會話信息如下:

> sessionInfo() 
R version 3.2.2 (2015-08-14) 
Platform: x86_64-pc-linux-gnu (64-bit) 
Running under: Ubuntu precise (12.04.5 LTS) 

locale: 
[1] LC_CTYPE=en_IN.UTF-8  LC_NUMERIC=C    LC_TIME=en_IN.UTF-8  LC_COLLATE=en_IN.UTF-8  LC_MONETARY=en_IN.UTF-8 LC_MESSAGES=en_IN.UTF-8 
[7] LC_PAPER=en_IN.UTF-8  LC_NAME=C     LC_ADDRESS=C    LC_TELEPHONE=C    LC_MEASUREMENT=en_IN.UTF-8 LC_IDENTIFICATION=C  

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

other attached packages: 
[1] data.table_1.9.6 plyr_1.8.3   git2r_0.11.0  ISLR_1.0   bigtabulate_1.1.2 biglm_0.9-1   DBI_0.3.1   biganalytics_1.1.1 
[9] bigmemory_4.4.6  BH_1.58.0-1   bigmemory.sri_0.1.3 highfrequency_0.4 xts_0.9-7   zoo_1.7-12   

loaded via a namespace (and not attached): 
[1] Rcpp_0.12.0  lattice_0.20-33 chron_2.3-47 grid_3.2.2  magrittr_1.5 stringi_1.0-1 reshape2_1.4.1 tools_3.2.2  stringr_1.0.0 

我不知道我現在應該做什麼。有人可以幫忙嗎?

回答

3

看起來像損壞的安裝。

  1. 關閉所有會話
  2. 開始在控制檯單一的清潔R對話(排除任何IDE問題)
  3. 安裝從GitHub資源庫的開發版本直接使用:

install.packages("data.table", repos = "https://Rdatatable.github.io/data.table") 
  1. 安裝後您可以可選通過

library(data.table) 
test.data.table() 

如果你想安裝最新版本CRAN只是跳過repos參數install.packages驗證所有測試。

+0

工作。謝謝! – UtdMan