2015-04-25 82 views
0

希望有人能幫忙。我昨天將R更新爲3.2.0,無法解決安裝軟件包「時空」的問題。我已經嘗試卸載並重新安裝,以防這可以解決它。我認爲這個問題與包「sp」有關,但不理解錯誤信息,我的搜索不成功。安裝R包時空

install.packages("spacetime") 
    Installing package into ‘C:/####/R/win-library/3.2’ 
    (as ‘lib’ is unspecified) 
    also installing the dependency ‘sp’ 


    There are binary versions available but the source versions are later: 
      binary source needs_compilation 
sp  1.0-17 1.1-0    TRUE 
spacetime 1.1-3 1.1-4    FALSE 

    Binaries will be installed 
trying URL 'http://cran.ms.unimelb.edu.au/bin/windows/contrib 
/3.2/sp_1.0-17.zip' 
Content type 'application/zip' length 1498250 bytes (1.4 MB) 
downloaded 1.4 MB 

package ‘sp’ successfully unpacked and MD5 sums checked 

The downloaded binary packages are in 
     C:\###\downloaded_packages 
installing the source package ‘spacetime’ 

trying URL 'http://cran.ms.unimelb.edu.au/src/contrib 
/spacetime_1.1-4.tar.gz' 
Content type 'application/x-gzip' length 3013768 bytes (2.9 MB) 
downloaded 2.9 MB 

* installing *source* package 'spacetime' ... 
** package 'spacetime' successfully unpacked and MD5 sums checked 
** R 
** data 
** demo 
** inst 
** preparing package for lazy loading 
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]])  : 
    namespace 'sp' 1.0-17 is being loaded, but  = 1.1.0 is required 
ERROR: lazy loading failed for package 'spacetime' 
* removing 'C:####/R/win-library/3.2/spacetime' 

The downloaded source packages are in 
     ‘C:\###\downloaded_packages’ 
Warning messages: 
1: running command '"C:/PROGRA~1/R/R-32~1.0/bin/x64/R" CMD INSTALL -l  "C:\####\R\win-library\3.2" C:####/downloaded_packages  /spacetime_1.1-4.tar.gz' had status 1 
2: In install.packages("spacetime") : 
    installation of package ‘spacetime’ had non-zero exit status 

我懷疑是被安裝了「SP」的錯誤版本,但我想我需要的最新版本,因此不知道我在正確讀取。

+0

感謝@Roland - 我嘗試了不同的鏡子,得到它的工作沒有意識到他們是不同的(我是壞是這個 :) )。 如果你把這個作爲一個答案,我會正確標註 –

回答

4

檢查正確的二進制文件是否在CRAN /不同的鏡像上。如果他們是,從那裏得到他們。否則,您可以從源代碼安裝(您需要安裝Rtools)或等到二進制文件更新。

有時鏡子可能落後一點。

1

您麻煩的原因似乎是spacetime預計sp版本1.1-0,但不知何故install.packages只能找到版本1.0-17的二進制文件。 sp安裝,但隨後spacetime失敗,因爲它沒有找到的sp相應的版本。

我已經檢查了CRAN上的Windows二進制文件sp 1.1-0存在:http://cran.r-project.org/web/packages/sp/index.html。嘗試下載sp_1.1-0.zip然後通過使用安裝:

install.packages("path_to_your_file/sp_1.1-0.zip",repos=NULL)