gpt4 book ai didi

r - 如何使用 Microsoft R Open 3.3.2 获得 rmarkdown 1.2

转载 作者:行者123 更新时间:2023-12-04 08:38:04 25 4
gpt4 key购买 nike

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

rmarkdown 1.2 is required but 1.1 is available





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 发行版)所做的一件事是将默认存储库指向静态时间点快照,以实现可重复性。
来自 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.


就您而言,您使用的快照截至 2016 年 11 月 1 日。当时,最新版本的 rmarkdown 是 1.1。如果您运行 install.packages ,您将获得该版本,而不是更新的版本。
如果你确实想要 rmarkdown 1.2,你可以在你的 install.packages 中覆盖默认的 repo。称呼:
install.packages("rmarkdown", repos="https://cloud.r-project.org")

关于r - 如何使用 Microsoft R Open 3.3.2 获得 rmarkdown 1.2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42300340/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com