0

我在 centos 7 上使用 R 当我尝试安装 bioconductor 软件包时,我收到以下错误。

> source("http://bioconductor.org/biocLite.R")
Bioconductor version 3.0 (BiocInstaller 1.16.1), ?biocLite for help
> biocLite("affy")
Error in read.table(file = file, header = header, sep = sep, quote = quote,  : 
  no lines available in input

这个错误似乎比仅仅biocLite因为使用的其他函数(如包rma中)也抛出相同的错误更大。我对如何解决这个错误一无所知。非常感谢任何帮助。谢谢。affyread.table

eset=rma(data,normalize=FALSE)
Error in read.table(file = file, header = header, sep = sep, quote = quote,  : 
  no lines available in input

@里奇棉花

我不确定你的意思,option(error = recover)但我尝试了以下

> source("http://bioconductor.org/biocLite.R")
Bioconductor version 3.0 (BiocInstaller 1.16.1), ?biocLite for help
> biocLite("affy")
Error in read.table(file = file, header = header, sep = sep, quote = quote,  : 
  no lines available in input
> traceback()
9: stop("no lines available in input")
8: read.table(file = file, header = header, sep = sep, quote = quote, 
       dec = dec, fill = fill, comment.char = comment.char, ...)
7: utils::read.delim(file, header = TRUE, comment.char = "#", colClasses = c(rep.int("character", 
       3L), rep.int("logical", 4L)))
6: tools:::.read_repositories(p)
5: setRepositories(ind = 1:20)
4: .biocinstallRepos(biocVersion = biocVersion)
3: .getContribUrl(biocVersion())
2: bioconductorPackageIsCurrent()
1: biocLite("affy")
> options(error=recover)
> biocLite("affy")
Error in read.table(file = file, header = header, sep = sep, quote = quote,  : 
  no lines available in input

Enter a frame number, or 0 to exit   

1: biocLite("affy")
2: bioconductorPackageIsCurrent()
3: .getContribUrl(biocVersion())
4: .biocinstallRepos(biocVersion = biocVersion)
5: setRepositories(ind = 1:20)
6: tools:::.read_repositories(p)
7: utils::read.delim(file, header = TRUE, comment.char = "#", colClasses = c(re
8: read.table(file = file, header = header, sep = sep, quote = quote, dec = dec

Selection: 8
Called from: top level 
Browse[1]> 
eval(expr,envir,enclos)
eval(substitute(browser(skipCalls=skip),list(skip=7...
4

1 回答 1

0

当文件存在但为空时,通常会出现错误消息

> system("touch /tmp/123")
> read.table("/tmp/123")
Error in read.table("/tmp/123") : no lines available in input

回溯说setRepositories()失败。看源头

> head(setRepositories, 9)

1 function (graphics = getOption("menu.graphics"), ind = NULL, 
2     addURLs = character())                                   
3 {                                                            
4     if (is.null(ind) && !interactive())                      
5         stop("cannot set repositories non-interactively")    
6     p <- file.path(Sys.getenv("HOME"), ".R", "repositories") 
7     if (!file.exists(p))                                     
8         p <- file.path(R.home("etc"), "repositories")        
9     a <- tools:::.read_repositories(p)  

存在但为空的文件是用户自定义

file.path(Sys.getenv("HOME"), ".R", "repositories")

(在这种情况下,解决方案是删除上面指向的文件)或系统文件

file.path(R.home("etc"), "repositories")

对于后一种情况,对我来说,我从源代码进行“全新”安装

> length(readLines(p))
[1] 20

但是张贴者可能会得到 0。这在某种程度上是 centOS 中的损坏安装,因此需要有关 R 的版本和安装的更多信息。我相信最近在 R-devel、R-help 或 R bug tracker 上有一篇关于此的帖子,但我一直没能找到它。

于 2014-11-20T12:55:41.300 回答