title: Download R and specific package as travis dependency
body: <p>I'm trying to set up CI for a julia package, but that also needs R and the R package 'ape'. As the julia package interacts with R. I'm having trouble setting up travis for this:</p>
  
  <pre><code>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"' &gt;  $HOME/.Renviron
      - echo 'options(repos=structure(c(CRAN="https://cloud.r-project.org/")))' &gt; .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"))'
  </code></pre>
  
  <p>So in the before_install section, I download R.
  Next I set up a local R package library, and set it in a .Renviron file, and then try to set a .Rprofile file with the default cran mirror to use.
  Then I run Rscript to download the package.</p>
  
  <p>However this does not  work in practice, there is some error about the URL scheme:</p>
  
  <pre><code>$ 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) 
  </code></pre>
  
  <p>How do I correctly install R and R packages as a dependency for a project that is not itself R (language: r)?</p>