- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有 plot 函数,可以像 glm 一样生成四个图。直方图、箱线图和两个散点图。但我无法将它们放在我文档中的正确位置,以便我可以看到所有信息。我想要 1 行中的 2 个图并且要宽,以便我可以看到标题等所有信息。
发布我的绘图函数毫无意义,因为它是针对我创建的类。
我有以下 YAML 布局:
---
title:
author:
fontsize: 11
graphics: true
documentclass: article
output:
pdf_document:
fig_caption: yes
toc: true
latex_engine: pdflatex
toc_depth: 2
number_sections: true
keep_tex: true
header-includes:
- \usepackage{graphicx}
- \usepackage{float}
- \usepackage{subfig}
---
```{r setup, include = FALSE}
library(knitr)
knitr::opts_chunk$set(fig.path = 'figures/', fig.pos = 'htb!', echo = TRUE)
knit_hooks$set(plot = function(x, options) {
hook_plot_tex(x, options)
})
```
```{r, out.width='1\\linewidth', fig.asp=0.5, fig.ncol = 1, fig.cap="output",fig.align = "center"}
par(mfrow = c(1, 2))
plot(poisReg)
```
最佳答案
我无法重现您的问题。使用一组可重现的图:
---
title:
author:
fontsize: 11
graphics: true
documentclass: article
output:
pdf_document:
fig_caption: yes
toc: true
latex_engine: pdflatex
toc_depth: 2
number_sections: true
keep_tex: true
header-includes:
- \usepackage{graphicx}
- \usepackage{float}
- \usepackage{subfig}
---
```{r setup, include = FALSE}
library(knitr)
knitr::opts_chunk$set(fig.path = 'figures/', fig.pos = 'htb!', echo = TRUE)
knit_hooks$set(plot = function(x, options) {
hook_plot_tex(x, options)
})
```
```{r, out.width='1\\linewidth', fig.asp=0.5, fig.ncol = 1, fig.cap="output",fig.align = "center"}
par(mfrow = c(1, 2))
plot(cars, main = "Title 1")
plot(cars, main = "Title 2")
plot(cars, main = "Title 3")
plot(cars, main = "Title 4")
```
在我看来,knitr 设置 figures
文件夹时出现问题。
关于r - 在 RMarkdown 中的单个图形中绘制多个图的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49395974/
我正在尝试使用此示例将 3 个文件编织在一起:http://rmarkdown.rstudio.com/rmarkdown_websites.html 我的文件都共享同一个目录,该目录已在 RStud
我正在将 Rmarkdown 与 python 一起使用。相当于R python的内联代码? 例如,在 https://rmarkdown.rstudio.com/lesson-4.html我可以 `
我正在用 Rmarkdown 编写一系列相互补充的报告。我想将上一份报告的结果包含在我目前正在处理的报告中。我看到其他问题建议使用 purl 从 Rmarkdown 文档中提取 R 代码然后运行它,所
我想演示如何编写 RMarkdown,其中所说的 RMarkdown 演示嵌入在用于创建类(class) Material 的 RMarkdown 文档中。在这个围栏代码块中,我不希望 knitr 执
我在 Amazon AWS EC-2(Amazon Linux AMI 2015.09.1 (HVM),SSD Volume Type - ami-60b6c60a)上安装了一个 Shiny 的服务器
我刚刚开始使用 rmarkdown、pandoc 和 knitr。我在尝试让 pandoc 获取比 rmarkdown 文档高一级的图像时遇到了很多困难。例如,考虑我们的项目目录是 ~/test,下面
我希望将 Bootstrap 导航栏(如此处所示:https://getbootstrap.com/docs/4.0/components/navbar/)添加到我正在创建的 R Markdown 模
我正在尝试通过 Rmarkdown 并排打印两个表格,输出为 PDF。 我可以很好地打印这些表格,但它们最终靠得很近,我找不到在它们之间创造更多空间的方法。我在其他帖子中找到的解决方案返回奇怪的输出或
我报告了一个问题 https://github.com/rstudio/rmarkdown/issues/967我想知道是否有解决方法(如何使其工作)? 下面的可重现示例(改变 n 和 nGroup
我正在将 Rmarkdown PDF 文档与以下 YAML 设置放在一起: --- output: pdf_document: fig_caption: true fig_crop
我有类似于以下的代码,它是动态生成并存储在变量中的: --- title: "test" author: "me" date: "3 June 2019" output: html_document
我经常编写可供技术人员和高管阅读的 Markdown 文档。 从这个意义上说,我想知道是否可以在 HTML 中创建一个按钮来隐藏或显示最终输出中的代码块? 目前,我正在创建两个单独的文件,我认为这是一
我正在使用 rmarkdown 在 RStudio 中进行投影仪演示。我想在演示文稿的顶部获得幻灯片代码。德累斯顿主题应该支持那些股票 Dresden 那么是否有可能通过使用 rmarkdown 来获
我有一个简单的问题。我如何使用 Rmarkdown/knitr 创建词汇表。我与 RStudio 合作。 我尝试这个但没有成功 \usepackage{glossaries} 在 header.tex
我有R包,它的功能之一-产生报告。在inst/markdown中,我有一个模板rep.rmd。在包函数ProduceReport()中,我有以下代码: render.file <-"rep.Rmd
嗨,我想在我的 Rmarkdown 文件的一侧添加一个页面导航。如果它看起来像侧边栏就好了 on this page . --- title: "My Title" author: "My Name"
当我为学生准备教程时,我需要一种方法来隐藏可折叠面板中的内容,这些面板可以通过单击按钮来显示。我已经使用下面的代码让它工作了。 RMarkdown 文件如下所示: --- title: Collaps
我最近开始使用 r-markdown使用来自 rticles 的便捷模板准备期刊文章.但是,我们最终使用 Word 而不是 LaTex 提交。合作者更喜欢 Word,目前,并非所有期刊都接受 LaTe
我有两个 RMarkdown 文件。 main.Rmd这是渲染的主文件 example.Rmd它包含更长的示例并在其他地方使用(因此它存在于自己的文档中)。 我想包括example.Rmd在 main
在我的 R 文件中,我有: library(rmarkdown) rmarkdown::render("C://Users//me//Desktop//test_param.Rmd",
我是一名优秀的程序员,十分优秀!