R markdown:Figure-html文件夹未显示?

问题描述 投票:0回答:1

您好,我遇到了一个奇怪的问题,即编织过程中生成的数字“ figure-html”丢失了。过去,当我渲染rmd文件时,此文件夹将自动生成所有图形。但是,它不再这样做。

这里是一个通用示例:

---
title: "test"
date: "`r format(Sys.time(), '%d %B, %Y')`"
output:
  html_document:
    df_print: paged
  number_sections: yes
editor_options:
  chunk_output_type: console
fig_caption: yes
pdf_document:
  fig_caption: yes
classoption: a3paper
toc: yes
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

## R Markdown


```{r cars}
library(ggplot2)
ggplot(diamonds, aes(x=carat, y=price, color=cut)) + geom_point() + geom_smooth()
```



## R version 3.5.3 (2019-03-11)
## Platform: x86_64-w64-mingw32/x64 (64-bit)
## Running under: Windows 7 x64 (build 7601) Service Pack 1
## 
## Matrix products: default
## 
## locale:
## [1] LC_COLLATE=English_United States.1252 
## [2] LC_CTYPE=English_United States.1252   
## [3] LC_MONETARY=English_United States.1252
## [4] LC_NUMERIC=C                          
## [5] LC_TIME=English_United States.1252    
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## loaded via a namespace (and not attached):
##  [1] compiler_3.5.3  magrittr_1.5    tools_3.5.3     htmltools_0.3.6
##  [5] yaml_2.2.0      Rcpp_1.0.2      stringi_1.4.3   rmarkdown_1.14 
##  [9] knitr_1.24      stringr_1.4.0   xfun_0.8        digest_0.6.20  
## [13] evaluate_0.14
r r-markdown
1个回答
0
投票

好吧,我找到了解决方案。在html_document下添加以下

output:
  html_document:
    df_print: paged
    self_contained: no
    keep_md: yes

如果仍然无法使用,请稍稍更改标题。由于某种原因,如果第一次渲染未生成文件夹(或更可能生成但随后自动删除了该文件夹),则后续渲染将不会。

© www.soinside.com 2019 - 2024. All rights reserved.