Rstudio中的R找不到rmarkdown包 [英] R within Rstudio cannot find rmarkdown package

查看:420
本文介绍了Rstudio中的R找不到rmarkdown包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在PC上的Rstudio(0.98.953)中首次使用rmarkdown.我已经升级到R(3.1.1)和R studio的最新版本.在此问题的末尾提供了sessionInfo()的输出.

I am trying to use rmarkdown, within Rstudio (0.98.953) on a PC, for the first time. I have upgraded to the latest versions of R (3.1.1) and R studio. The output from sessionInfo() is provided at the end of this question.

据我了解,rmarkdown应该包含在Rstudio中.但是,当我选择在Rstudio中创建markdown文档时,会弹出一个对话框,提示需要安装其他软件包.然后,rmarkdown的安装总是失败,并显示以下消息:

As I understand it rmarkdown should be included within Rstudio. However, when I select to create a markdown document in Rstudio, a dialog box pops up saying additional packages need to be installed. The installation of rmarkdown always then fails, with the following message:

Installing package into '\\cfsk18.campus.gla.ac.uk/SSD_Home_Data_X/jm383x/My        Documents/R/win-library/3.1'
(as 'lib' is unspecified)
* installing *source* package 'rmarkdown' ...
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
*** arch - i386
Warning in library(pkg_name, lib.loc = lib, character.only = TRUE, logical.return =     TRUE) :
  there is no package called 'rmarkdown'
Error: loading failed
Execution halted
*** arch - x64
Warning in library(pkg_name, lib.loc = lib, character.only = TRUE, logical.return =     TRUE) :
  there is no package called 'rmarkdown'
Error: loading failed
Execution halted
ERROR: loading failed for 'i386', 'x64'
* removing '\\cfsk18.campus.gla.ac.uk/SSD_Home_Data_X/jm383x/My Documents/R/win-    library/3.1/rmarkdown'
Warning messages:
1: running command '"C:/PROGRA~1/R/R-31~1.1/bin/x64/R" CMD INSTALL -l "\\cfsk18.campus.gla.ac.uk\SSD_Home_Data_X\jm383x\My Documents\R\win-library\3.1"     "C:/PROGRA~1/RStudio/R/packages/rmarkdown_0.2.49_047a80058bb4ef0b142196013d1c4dd8870d4dd9.tar.gz"' had status 1 
2: In utils::install.packages("C:/Program     Files/RStudio/R/packages/rmarkdown_0.2.49_047a80058bb4ef0b142196013d1c4dd8870d4dd9.tar.gz",      :
  installation of package     'C:/PROGRA~1/RStudio/R/packages/rmarkdown_0.2.49_047a80058bb4ef0b142196013d1c4dd8870d4dd9.tar.gz' had non-zero exit status

我认为这与在工作场所使用托管桌面有关.但是,这通常不是问题,因为对这些计算机的限制比通常少得多,并且所有其他软件包,软件等都可以使用.

I assume this is something to do with using a managed desktop in my place of work. However this is not usually a problem as far fewer restrictions are placed on these machines than is usually the case, and all other packages, software etc tend to work.

我也尝试过直接从github安装rmarkdown.同样,安装程序无法识别软件包rmarkdown本身.

I have also tried installing rmarkdown directly from github. Again the installer cannot identify the package rmarkdown itself.

错误的可能原因是什么?

What is likely to be the cause of the error?

R version 3.1.1 (2014-07-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=English_United Kingdom.1252  LC_CTYPE=English_United Kingdom.1252        LC_MONETARY=English_United Kingdom.1252
[4] LC_NUMERIC=C                            LC_TIME=English_United Kingdom.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] tools_3.1.1

尝试直接从github repo安装:

devtools::install_github("rstudio/rmarkdown")
Installing github repo rmarkdown/master from rstudio
Downloading master.zip from https://github.com/rstudio/rmarkdown/archive/master.zip
Installing package from C:\Users\jm383x\AppData\Local\Temp\RtmpINmLRv/master.zip
Installing rmarkdown
Installing dependencies for rmarkdown:
httpuv
Installing package into ‘\\cfsk18.campus.gla.ac.uk/SSD_Home_Data_X/jm383x/My     Documents/R/win-library/3.1’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.1/httpuv_1.3.0.zip'
Content type 'application/zip' length 857357 bytes (837 Kb)
opened URL
downloaded 837 Kb

package ‘httpuv’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
    C:\Users\jm383x\AppData\Local\Temp\RtmpINmLRv\downloaded_packages
"C:/PROGRA~1/R/R-31~1.1/bin/x64/R" --vanilla CMD INSTALL  \
  "C:\Users\jm383x\AppData\Local\Temp\RtmpINmLRv\devtoolscec10833677\rmarkdown-master"       \
  --library="\\cfsk18.campus.gla.ac.uk/SSD_Home_Data_X/jm383x/My Documents/R/win-   library/3.1" --install-tests 

* installing *source* package 'rmarkdown' ...
** R
** inst
** tests
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
*** arch - i386
    Warning in library(pkg_name, lib.loc = lib, character.only = TRUE, logical.return =     TRUE) :
      there is no package called 'rmarkdown'
    Error: loading failed
    Execution halted
    *** arch - x64
     Warning in library(pkg_name, lib.loc = lib, character.only = TRUE, logical.return = TRUE) :
  there is no package called 'rmarkdown'
    Error: loading failed
    Execution halted
    ERROR: loading failed for 'i386', 'x64'
* removing '\\cfsk18.campus.gla.ac.uk/SSD_Home_Data_X/jm383x/My Documents/R/win-      library/3.1/rmarkdown'

推荐答案

尝试运行以下代码以获取rmarkdown软件包的最新版本,这应该可以解决该问题:

Try running this code to get the latest version of the rmarkdown package, which should solve the issue:

install.packages("rmarkdown", repos = "https://cran.revolutionanalytics.com")

问题是RStudio IDE会查看更新rmarkdown软件包之前拍摄的静态CRAN快照.有关更多信息,请参见以下链接: https://groups.google.com/forum /#!topic/rropen/Kgg8z6FF40I

The issue is that the RStudio IDE looks at a static CRAN snapshot that was taken before the rmarkdown package was updated. For more information, see this link: https://groups.google.com/forum/#!topic/rropen/Kgg8z6FF40I

这篇关于Rstudio中的R找不到rmarkdown包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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