相关疑难解决方法(0)

在 R Markdown PDF 输出中更改绘图图表大小的输出宽度

在A R降价文件,没有人知道为什么out.widthout.heightfigure.widthfigure.height产生一个PDF文件时参数不plotly改变图表的大小?(我确切地说这些参数可以完美地使用plot函数)

请在下面找到带有 Rmarkdown 文件的可复制示例

在这个例子中,我希望 plotly 图表像 plot 图表一样占据整个工作表。

---
title: "Change chart size chart on pdf file using plotly"
output:
  pdf_document: default
---

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

```

## Parameters doesn't work with plotly  

```{r, out.width='100%',out.height='100%',fig.height=20, fig.width=15, fig.align="left"}
library(plotly)
plot_ly(x = cars[1:10,]$speed,y = cars[1:10,]$dist)
```

## Parameters works using plot function

```{r,out.width='130%',out.height='100%', fig.height=20, fig.width=15, fig.align="left"}
plot(cars[1:10,])
```
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明

pdf-generation r knitr r-markdown r-plotly

4
推荐指数
1
解决办法
8303
查看次数

R markdown编译错误:

当我尝试将Rmarkdown文档编译为pdf时,出现以下错误:

    Error: Functions that produce HTML output found in document targeting latex output.
Please change the output type of this document to HTML. Alternatively, you can allow
HTML output in non-HTML formats by adding this option to the YAML front-matter of
your rmarkdown file:

  always_allow_html: yes

Note however that the HTML output will not be visible in non-HTML formats.
Run Code Online (Sandbox Code Playgroud)

有人知道这意味着什么吗?

r rstudio knitr r-markdown

2
推荐指数
2
解决办法
4731
查看次数

标签 统计

knitr ×2

r ×2

r-markdown ×2

pdf-generation ×1

r-plotly ×1

rstudio ×1