【问题标题】:Figures are not displayed in html R Markdownhtml R Markdown中不显示数字
【发布时间】:2013-06-03 15:53:51
【问题描述】:

我对 R Markdown 和 knitr 还很陌生。

我正在尝试在我的报告中添加一些数字:

![my figure](/figure/another_folder/my_picture.png)

假设 /figure/another_folder/ 在当前工作目录中。但是我的报告中没有任何数字,只有问号。

系统信息:

> sessionInfo()
R version 3.0.1 (2013-05-16)
Platform: x86_64-apple-darwin10.8.0 (64-bit)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages:
[1] knitr_1.2

loaded via a namespace (and not attached):
 [1] colorspace_1.2-2   dichromat_2.0-0    digest_0.6.3       evaluate_0.4.3     formatR_0.7       
 [6] ggplot2_0.9.3.1    grid_3.0.1         gtable_0.1.2       labeling_0.1       MASS_7.3-26       
[11] munsell_0.4        plyr_1.8           proto_0.3-10       RColorBrewer_1.0-5 reshape2_1.2.2    
[16] scales_0.2.3       stringr_0.6.2      tools_3.0.1  

我还找到了运行诊断报告的建议(在 r-studio 支持页面上):

> rstudio::diagnosticsReport()
Error: package ‘rstudio’ was built before R 3.0.0: please re-install it

这可以连接吗?如果是这样,我应该如何重新安装 R-studio?我的卸载.app?因为运行 install.packages('rstudio') 只会产生警告:Warning message: package ‘rstudio’ is not available (for R version 3.0.1)

【问题讨论】:

  • 在 .Rmd 中添加 `r getwd()` 以确保您位于您认为的目录中。
  • Rstudio 不是一个包,而是一个开发环境(即,R 的一个“插件”,它可以在 UI 中为您提供方便的功能)。如果您没有最新版本,只需从他们的网站下载最新的可执行文件并安装。这可能是您的问题,因为降价是 Rstudio 及其功能的一部分..
  • 你真的有/figure/....中的斜线/吗? rstudio 包在这里应该无关紧要,但您可能需要升级 RStudio。

标签: html r markdown knitr


【解决方案1】:

嗯,问题是第一个斜线。如果我这样写:

![my figure](figure/another_folder/my_picture.png)

一切都很好。很抱歉误读了手册!

【讨论】:

    猜你喜欢
    • 2016-09-04
    • 2018-06-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-21
    • 2021-10-11
    • 2012-06-11
    • 2021-09-17
    相关资源
    最近更新 更多