如何使用Microsoft R Open 3.3.2获取rmarkdown 1.2 [英] How do I get rmarkdown 1.2 with Microsoft R Open 3.3.2

查看:235
本文介绍了如何使用Microsoft R Open 3.3.2获取rmarkdown 1.2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将RStudio 1.0.136与Microsoft R Open 3.3.2一起使用,当我执行File-> New File-> R Markdown ...时说

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是必需的,但1.1是可用的

rmarkdown 1.2 is required but 1.1 is available

还有

检查getOption("repos")是否指向包含所需软件包版本的CRAN存储库

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

还有

getOption("repos")给我这个:

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

我从这里去哪里?

推荐答案

我们使用MRO(和其他MS R发行版)要做的一件事是将默认存储库指向静态时间点快照,以便可重复性的目的.

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.

来自 https://mran.revolutionanalytics.com/documents/rro/reproducibility/:

例如,您昨天使用的软件包可能已在一夜之间进行了更新,或者其中一个依赖项进行了更新,现在您的脚本不再能按预期工作.开发人员想知道,他们什么时候计划修复和更新此软件包?我需要重写我的脚本吗?"无论维护者何时选择,软件包都会得到修复-无论是今天,明天还是下个月.每次软件包中断时,所有使用该版本软件包的脚本都会中断.就R程序员渴望的稳定性而言,这种方法显然不是最佳的.

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.

类似地,每当用户指向最新的CRAN存储库时,install.packages可以今天为"User_A"安装一个版本的软件包,为"User_B"安装相同版本的另一个版本,指向另一个镜像,甚至"User_C"明天尝试安装时出现未找到软件包"错误.再次,这种不一致在共享脚本时提出了挑战.

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.

在您的情况下,您使用的快照截至2016年11月1日.那时,rmarkdown的最新版本为1.1.如果运行install.packages,则将获得该版本,而不是最新版本.

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.

如果您确实想要rmarkdown 1.2,则可以在install.packages调用中覆盖默认存储库:

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")

这篇关于如何使用Microsoft R Open 3.3.2获取rmarkdown 1.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆