包'classInt'不可用(对于R版本3.1.0)

时间:2014-04-28 08:46:57

标签: r install package r-raster

我尝试安装包raster,因为classInt未安装,因此我退出状态为非零。

我最近更新并升级了Ubuntu上的所有R软件包和R-core(到3.1)。

现在,如果我尝试从CRAN存储库安装软件包classInt,或者甚至手动执行(下载tar.gz并设置repos),我会收到以下错误代码:

package ‘classInt’ is not available (for R version 3.1.0)

关于如何调试这个的想法?

整个错误输出完成帖子:

> install.packages("raster")
Installing package into ‘/home/user/R/x86_64-pc-linux-gnu-library/3.1’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/src/contrib/raster_2.2-31.tar.gz'
Content type 'application/x-gzip' length 1049759 bytes (1.0 Mb)
opened URL
==================================================
  downloaded 1.0 Mb

Error in library("classInt") : there is no package called ‘classInt’
Execution halted
Warning in install.packages :
  installation of package ‘raster’ had non-zero exit status

The downloaded source packages are in
‘/tmp/RtmpaJUU7d/downloaded_packages’
> 



  > install.packages("classInt")

Installing package into ‘/home/user/R/x86_64-pc-linux-gnu-library/3.1’
(as ‘lib’ is unspecified)
also installing the dependency ‘e1071’

trying URL 'http://cran.rstudio.com/src/contrib/e1071_1.6-3.tar.gz'
Content type 'application/x-gzip' length 583697 bytes (570 Kb)
opened URL
==================================================
  downloaded 570 Kb

trying URL 'http://cran.rstudio.com/src/contrib/classInt_0.1-21.tar.gz'
Content type 'application/x-gzip' length 18213 bytes (17 Kb)
opened URL
==================================================
  downloaded 17 Kb

Error in library("classInt") : there is no package called ‘classInt’
Execution halted
Warning in install.packages :
  installation of package ‘e1071’ had non-zero exit status
Error in library("classInt") : there is no package called ‘classInt’
Execution halted
Warning in install.packages :
  installation of package ‘classInt’ had non-zero exit status

The downloaded source packages are in
‘/tmp/RtmpaJUU7d/downloaded_packages’
> 


  > install.packages("~/R/Packages/classInt_0.1-21.tar.gz",repos=NULL, type="source")

Installing package into ‘/home/user/R/x86_64-pc-linux-gnu-library/3.1’
(as ‘lib’ is unspecified)
Error in library("classInt") : there is no package called ‘classInt’
Execution halted
Warning in install.packages :
  installation of package ‘/home/user/R/Packages/classInt_0.1-21.tar.gz’ had non-zero exit status
> 

这里是会话信息:

  > sessionInfo()
R version 3.1.0 (2014-04-10)
Platform: x86_64-pc-linux-gnu (64-bit)

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

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

loaded via a namespace (and not attached):
  [1] tools_3.1.0

和选项()

  > options()
$add.smooth
[1] TRUE

$bitmapType
[1] "cairo"

$browser
function (url) 
{
  .Call("rs_browseURL", url)
}
<environment: 0x45ec5b0>

  $browserNLdisabled
[1] FALSE

$CBoundsCheck
[1] FALSE

$check.bounds
[1] FALSE

$citation.bibtex.max
[1] 1

$continue
[1] "+ "

$contrasts
unordered           ordered 
"contr.treatment"      "contr.poly" 

$defaultPackages
[1] "datasets"  "utils"     "grDevices" "graphics"  "stats"     "methods"  

$demo.ask
[1] "default"

$deparse.cutoff
[1] 60

$device
[1] "RStudioGD"

$device.ask.default
[1] FALSE

$digits
[1] 7

$dvipscmd
[1] "dvips"

$echo
[1] TRUE

$editor
[1] "vi"

$encoding
[1] "native.enc"

$error
(function () 
{
  .rs.recordTraceback(userOnly)
})()

$example.ask
[1] "default"

$expressions
[1] 5000

$ggvis.renderer
[1] "svg"

$help.search.types
[1] "vignette" "demo"     "help"    

$help.try.all.packages
[1] FALSE

$help_type
[1] "html"

$HTTPUserAgent
[1] "R (3.1.0 x86_64-pc-linux-gnu x86_64 linux-gnu)"

$internet.info
[1] 2

$keep.source
[1] TRUE

$keep.source.pkgs
[1] FALSE

$locatorBell
[1] TRUE

$mailer
[1] "mailto"

$max.print
[1] 10000

$menu.graphics
[1] FALSE

$na.action
[1] "na.omit"

$nwarnings
[1] 50

$OutDec
[1] "."

$pager
function (files, header, title, delete.file) 
{
  for (i in 1:length(files)) {
    if ((i > length(header)) || !nzchar(header[[i]])) 
      fileTitle <- title
    else fileTitle <- header[[i]]
    .Call("rs_showFile", fileTitle, files[[i]], delete.file)
  }
}
<environment: 0x44790f8>

  $papersize
[1] "a4"

$pdfviewer
[1] "/usr/bin/xdg-open"

$pkgType
[1] "source"

$printcmd
[1] "/usr/bin/lpr"

$prompt
[1] "> "

$repos
CRAN 
"http://cran.univ-paris1.fr/" 

$rl_word_breaks
[1] " \t\n\"\\'`><=%;,|&{()}"

$scipen
[1] 0

$show.coef.Pvalues
[1] TRUE

$show.error.messages
[1] TRUE

$show.signif.stars
[1] TRUE

$str
$str$strict.width
[1] "no"

$str$digits.d
[1] 3

$str$vec.len
[1] 4


$str.dendrogram.last
[1] "`"

$stringsAsFactors
[1] TRUE

$texi2dvi
[1] "/usr/bin/texi2dvi"

$timeout
[1] 60

$ts.eps
[1] 1e-05

$ts.S.compat
[1] FALSE

$unzip
[1] "/usr/bin/unzip"

$useFancyQuotes
[1] TRUE

$verbose
[1] FALSE

$viewer
function (url, height = NULL) 
{
  if (!is.character(url) || (length(url) != 1)) 
    stop("url must be a single element character vector.", 
         call. = FALSE)
  if (!is.null(height) && (!is.numeric(height) || (length(height) != 
                                                     1))) 
    stop("height must be a single element integer vector.", 
         call. = FALSE)
  invisible(.Call("rs_viewer", url, height))
}
<environment: 0x45ec5b0>

  $warn
[1] 0

$warning.length
[1] 1000

$width
[1] 122

1 个答案:

答案 0 :(得分:2)

好的,事实证明问题在于.Rprofile的使用。 .Rprofile是一个在每个RSession开始时自动执行的小脚本。它应该增强您的工作流程,因为您可以在那里调用一些常用的库,而不是每次都在脚本中调用它们。

当我仍在使用R 2.15时,我使用file.edit("/home/user/R/.Rprofile")编辑了此个人资料,并使用classInt拨打了library("classInt"). 现在,在升级到R 3.1之后,创建了包的新库路径,并且需要再次重新安装大多数其他包。那时我没有重新安装classInt。

现在R做的是每次classInt在启动时调用,因为没有安装软件包并且生成了错误消息Error in library("classInt") : there is no package called 'classInt'。我在启动时总是忽略这个消息,因为它不会影响我。

现在从library("classInt")删除行.Rprofile后,我可以安装raster包而不会显示任何错误消息,我也可以重新安装classInt或任何其他所需的包。所以我猜想在会话启动时调用classInt失败后,R无法安装任何软件包。