作为travis dependency下载R和特定包

作为travis dependency下载R和特定包,r,julia,travis-ci,R,Julia,Travis Ci,我正在尝试为julia包设置CI,但这也需要R和R包“ape”。julia软件包与R交互时,我在设置travis时遇到问题: language: julia os: - linux - osx julia: - 0.6 notifications: email: false before_install: # linux - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-key adv --keyserver

我正在尝试为julia包设置CI,但这也需要R和R包“ape”。julia软件包与R交互时,我在设置travis时遇到问题:

language: julia
os:
  - linux
  - osx
julia:
  - 0.6
notifications:
  email: false
before_install:
    # linux
    - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9; fi
    - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo add-apt-repository -y "deb http://cran.rstudio.com/bin/linux/ubuntu $(lsb_release -s -c)/"; fi
    - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get update -qq -y; fi
    - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install git r-base r-base-dev r-recommended -y; fi

    # osx
    # faster than using homebrew/science tap
    # but no permalink to release download
    - if [ "$TRAVIS_OS_NAME" == "osx" ]; then wget "https://cran.rstudio.com/bin/macosx/$(wget -qO- https://cran.rstudio.com/bin/macosx/ | sed -n 's/.*href="\(R-[^"]*.pkg\)".*/\1/p' | head -n 1)"; fi
    - if [ "$TRAVIS_OS_NAME" == "osx" ]; then sudo installer -pkg R-*.pkg -target /; fi

    - mkdir -p mkdir $HOME/R/library
    - echo 'R_LIBS_USER="~/R/library"' >  $HOME/.Renviron
    - echo 'options(repos=structure(c(CRAN="https://cloud.r-project.org/")))' > .Rprofile
    - Rscript -e 'install.packages("ape")'
after_success:
  - julia -e 'cd(Pkg.dir("BioBridgeR")); Pkg.add("Coverage"); using Coverage; Codecov.submit(process_folder())'
  - julia -e 'cd(Pkg.dir("BioBridgeR")); Pkg.add("Documenter"); include(joinpath("docs", "make.jl"))'
所以在安装前一节中,我下载了R。 接下来,我设置了一个本地R包库,并将其设置在.Renviron文件中,然后尝试使用默认的cran镜像设置.Rprofile文件。 然后我运行Rscript下载包

但是,这在实践中不起作用,URL方案存在一些错误:

$ Rscript -e 'install.packages("ape")'
Installing package into ‘/home/travis/R/library’
(as ‘lib’ is unspecified)
Warning: unable to access index for repository https://cloud.r-project.org/src/contrib:
  unsupported URL scheme
Warning message:
package ‘ape’ is not available (for R version 3.2.5) 

如何正确地将R和R软件包安装为一个本身不是R(语言:R)的项目的依赖项?

我总是像这样从终端安装
R
软件包:
sudo su--c“R-e\”install.packages('devtools',repos='http://cran.rstudio.com/“)\”
。尝试使用
'http://cran.rstudio.com/“
作为回购协议的参数,并查看是否仍会出现相同的错误。嗨,Gregor,使用已工作的!如果你想补充这一点作为回答,我会接受:)我不确定这是否真的是个棘手的问题。这也可能是一个问题。如果您可以尝试使用
repos=”进行安装http://cloud.r-project.org/“
同样,这可以大大提高答案的质量。因为您使用的是julia,所以可以执行
julia-e”Pkg.add(“Conda”);使用康达;Conda.add(“r-ape”)。
R
已安装到
Conda.前缀中