html - 在 Rmarkdown 中运行后,绘图未显示在 HTML 文件中
问题描述
当我在 Rmarkdown 中生成绘图时,它显示在 Rstudio 的绘图下,但在我编织它时不包括它。如何在降价中包含情节?
我还选中了“创建独立的 HTML 文档”,并且类似的图不会显示在该独立的 HTML 文档中。
例如,我在 Rmarkdown 文件中运行此代码,但绘图不会留在针织文档中。
boxplot(bwt ~ smoke, data=birthwt,
xlab = "drivetrain (0 = don't smoke, 1 = smoke)",
ylab = "birth wt. in g",
main = "birth weight vs smoking status",
pch = 20,
cex = 2,
col = "darkslategray",
border = "goldenrod3")
请指教。
解决方案
It does work in the following small snippet of RMD
---
title: "testing"
author: "akrun"
date: "10/05/2021"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r}
library(MASS)
data(birthwt)
boxplot(bwt ~ smoke, data=birthwt,
xlab = "drivetrain (0 = don't smoke, 1 = smoke)",
ylab = "birth wt. in g",
main = "birth weight vs smoking status",
pch = 20,
cex = 2,
col = "darkslategray",
border = "goldenrod3")
```
-output
推荐阅读
- java - 如何在 Java 中使用 Bouncy Castle 签署公共 PGP 密钥
- android - 如何在 Firestore Android 中查询参考字段?
- php - Laravel api 调用失败
- reactjs - 'React' 已定义但从未使用过。(没有未使用的变量)
- php - 返回并比较最高计数php mysql的值
- java - 如何将所有 youtube 视频 url 以将代码嵌入到 java 中的字符串中?
- https - https 无法建立私有连接
- java - 如何正确删除 JavaFX 中的动画图像
- android - Android 计划每 5 秒一次工作一次
- angularjs - 如何使用 ngRoute 进行路由(附 Demo)