首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >创建the服务器CRAN存储库-目录结构故障排除

创建the服务器CRAN存储库-目录结构故障排除
EN

Stack Overflow用户
提问于 2012-06-16 19:10:41
回答 1查看 1.3K关注 0票数 5

我正在尝试弄清楚如何创建一个http CRAN存储库。我曾尝试使用local CRAN repository,但没有真正成功。

基本上我的本地存储库是这样设置的(我不确定源代码目录是否有意义,但为了以防万一,我添加了它):

代码语言:javascript
复制
library(tools)
reposRoot <- "C:\\Software\\repository"
r_ver <- "2.15"
contribPaths <- c(source = "src\\contrib", windows = "bin\\windows\\contrib")
write_PACKAGES(paste(reposRoot, contribPaths["windows"], r_ver, sep="\\"), 
               type="win.binary",
               unpacked=FALSE,
               latestOnly=FALSE,
               verbose=TRUE)
write_PACKAGES(paste(reposRoot, contribPaths["source"], r_ver, sep="\\"), 
               type="source",
               unpacked=FALSE,
               latestOnly=FALSE,
               verbose=TRUE)

然后我已经将存储库上传到我的get服务器:cran.gforge.se,但是当我尝试查找包时,我得到了:

代码语言:javascript
复制
> available.packages(contriburl="http://cran.gforge.se")
Warning: unable to access index for repository http://cran.gforge.se
     Package Version Priority Depends Imports LinkingTo Suggests Enhances OS_type License Archs
     File Repository

所以我的结论是它找不到存储库,但奇怪的是当我尝试的时候:

代码语言:javascript
复制
> available.packages(contriburl="http://cran.gforge.se/bin/windows/contrib/2.15")
      Package Version Priority Depends                                                   Imports
Gmisc "Gmisc" "0.2"   NA       "grid, testthat, miscTools, rms, Hmisc, survival, cmprsk" NA     
      LinkingTo Suggests Enhances OS_type License      Archs File
Gmisc NA        NA       NA       NA      "GPL (>= 2)" NA    NA  
      Repository                                                    
Gmisc "http://cran.gforge.se/bin/windows/contrib/2.15/./src/contrib"

它实际上找到了我漂亮的包,但路径却是混乱的。如果我尝试运行安装,我会得到这样的结果:

代码语言:javascript
复制
> install.packages("Gmisc", contriburl="http://cran.gforge.se/")
Installing package(s) into ‘C:/Users/max/R/win-library/2.15’
(as ‘lib’ is unspecified)
Warning in install.packages :
  package ‘Gmisc’ is not available (for R version 2.15.0)
> install.packages("Gmisc", contriburl="http://cran.gforge.se/bin/windows/contrib/2.15")
Installing package(s) into ‘C:/Users/max/R/win-library/2.15’
(as ‘lib’ is unspecified)
trying URL 'http://cran.gforge.se/bin/windows/contrib/2.15/./src/contrib/Gmisc_0.2.zip'
Warning in install.packages :
  cannot open: HTTP status was '500 Internal Server Error'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'http://cran.gforge.se/bin/windows/contrib/2.15/./src/contrib/Gmisc_0.2.zip'
Warning in install.packages :
  download of package ‘Gmisc’ failed

我在the manualSONIVIS wiki上寻求过任何帮助,但我肯定是盲目的……请指引我:-S

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-06-20 03:34:28

经过一番搜索,我发现:

这个包不应该由R CMD INSTALL --build

  • Instead构建,而应该由
  1. 构建,它似乎可以与R CMD BUILD一起工作:

install.packages("Gmisc",repos=c("http://ftp.sunet.se/pub/lang/CRAN","http://cran.gforge.se"),Gmisc

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/11062884

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档