carpentries / lesson-example

Example lesson using The Carpentries lesson template.
https://carpentries.github.io/lesson-example/
Other
64 stars 173 forks source link

Avoid "CRAN without setting a mirror" #51

Open rgaiacs opened 8 years ago

rgaiacs commented 8 years ago

Copy http://stackoverflow.com/a/8475208/1802726 as instruction to solve

$ make serve      
Loading required package: knitr
Loading required package: stringr
Loading required package: checkpoint

checkpoint: Part of the Reproducible R Toolkit from Microsoft
https://mran.microsoft.com/documents/rro/reproducibility/
Installing missing required packages: ggplot2
Installing package into ‘/home/raniere/R/x86_64-pc-linux-gnu-library/3.3’
(as ‘lib’ is unspecified)
Error in contrib.url(repos, type) : 
  trying to use CRAN without setting a mirror
Calls: source ... generate_md_episodes -> install.packages -> grep -> contrib.url
Execution halted
make: *** [Makefile:84: lesson-rmd] Error 1
gvwilson commented 8 years ago

I don't understand what is being asked for here.

rgaiacs commented 8 years ago

@gvwilson make with fail if I didn't have setup the CRAN mirror that R should use by default (what is the case for Python uses). We should add .Rprofile on this repository to store

options(repos=structure(c(CRAN="https://cran.cnr.berkeley.edu/")))
gvwilson commented 8 years ago

I'm -1 on setting up a .Rprofile in this repo - lots of our authors will have .Rprofile files of their own. Is there a way to modify the Makefile to:

  1. make building the .Rmd files optional
  2. only do the .Rmd-to-.md translation that's actually needed?

Right now, the .Rmd files are always translated (all of them, every time), and I don't understand why.