【发布时间】:2016-04-06 14:40:39
【问题描述】:
我在 RStudio 中使用 knitr 和 dismo 包。尽我所能,我无法让使用 gmap 创建的绘图立即出现在 R 标记中的文本之后。
这里有一小部分 R 标记,可用于重新创建它。您需要安装三个引用的包。
我正在使用 RStudio,我正在这个环境中执行 knitr 命令。
---
title: "gmap"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(dismo)
library(rgdal)
library(XML)
```
The plot should follow this text
```{r plot, fig.align='left', echo=FALSE, message=FALSE}
g = gmap('Australia')
plot(g)
```
and precede this. Try as I might, there is white space between the start text and the image which I cannot get rid of.
我找不到任何方法来使用 knitr 指令控制图像的高度,而且 Google 没有提供明显的答案。有没有人见过这个并且可以提供任何建议?
编辑:我有一个解决方法,可以绘制到 png 文件,然后将其包含在内。这避免了这个问题,但很笨重。
【问题讨论】:
标签: r rstudio r-markdown