4

I am using RStudio 1.0.136 with Microsoft R Open 3.3.2 When I do File --> New File --> R Markdown... it says

rmarkdown 1.2 is required but 1.1 is available

And

Check that getOption("repos") refers to a CRAN repository that contains the needed package versions

And

getOption("repos") gives me this:

                                                      CRAN 
"https://mran.revolutionanalytics.com/snapshot/2016-11-01" 
                                                 CRANextra 
                      "http://www.stats.ox.ac.uk/pub/RWin" 

Where do I go from here?

Frank
  • 66,179
  • 8
  • 96
  • 180
whirlaway
  • 199
  • 1
  • 10
  • Did you try updating the `markdown` package? – Karthik Arumugham Feb 17 '17 at 14:30
  • Yes. It says "All packages are up to date". – whirlaway Feb 17 '17 at 14:40
  • Try to install `rmarkdown` package again. `install.packages("rmarkdown")`. The latest version that I have is 1.3. – Karthik Arumugham Feb 17 '17 at 15:19
  • 1
    MS R fixes the package repository to the date that they released that version of their R distribution. To get newer packages, you can use the repos argument to refer to a different repository. Something like `update.packages(repos="https://mran.revolutionanalytics.com/snapshot/2016-02-16")` should provide you with the latest and greatest. – lmo Feb 17 '17 at 15:34
  • Tried it. I still get 1.1 Perhaps it has to with the location that I see in the getOptions("repos") output? It says "mran". Should it be a "cran" path instead? – whirlaway Feb 17 '17 at 15:36
  • 2
    It should have been `update.packages(repos="https://mran.revolutionanalytics.com/‌​snapshot/2017-02-16"‌​)`. Darn year changes. This will update all of your packages. If you only want to update `rmarkdown` and its dependencies and leave other packages alone, use the code in the answer. – lmo Feb 17 '17 at 15:49
  • lmo, it didn't work. I still see rmarkdown version 1.1 in my listing. – whirlaway Feb 17 '17 at 15:53
  • Oh, I am trying with the "2017" now. Seems to be taking time... I still see 1.1 for rmarkdown but it seems to be working (but there is a different problem! Not sure what is going on. – whirlaway Feb 17 '17 at 16:03

1 Answers1

9

One of the things we do with MRO (and other MS R distributions) is to point the default repository to a static point-in-time snapshot, for the purposes of reproducibility.

From https://mran.revolutionanalytics.com/documents/rro/reproducibility/:

For example, a package you used yesterday may have been updated overnight, or maybe one of its dependencies did, and now your script no longer works as expected. Developers are left wondering, "When do they plan to fix and update this package? Do I need to rewrite my script?” Packages get fixed whenever their maintainers choose to do so -- whether that's today, tomorrow, or next month. Each time a package breaks, so will all of the scripts using that version of the package. This approach is clearly suboptimal with respect to the stability that R programmers crave.

Similarly, whenever users point to the latest CRAN repository, install.packages could install one version of the package for 'User_A' today, another version of that same package for 'User_B' who points to a different mirror, or even a “package not found” error when 'User_C' attempts to install tomorrow. Once again, this inconsistency presents challenges when sharing scripts.

In your case, the snapshot you're using is as of Nov 1, 2016. At that date, the latest version of rmarkdown was 1.1. If you run install.packages, you will get that version and not anything more recent.

If you definitely want rmarkdown 1.2, you can override the default repo in your install.packages call:

install.packages("rmarkdown", repos="https://cloud.r-project.org")
Community
  • 1
  • 1
Hong Ooi
  • 56,353
  • 13
  • 134
  • 187