opts

编程入门 行业动态 更新时间:2024-10-22 15:24:49
本文介绍了opts_current:如何在knitr中工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我试图在不同的块中设置不同的图形尺寸.我首先使用以下命令定义全局设置:

I am trying to set up different figure size in different chunks. I first define a global settings using:

opts_chunk$set(fig.width=7, fig.height=7)

然后,对于特定的块,我使用:

Then, for the specific chunks, I use:

opts_current$set(fig.width=7, fig.height=14)

但是后者总是被忽略.那么,opts_current到底如何工作?

But the later is always neglected. So, how does opts_current really work?

推荐答案

对于特定的代码块,请将块选项放在块头中,例如

For specific code chunks, put the chunk options in the chunk header, e.g.

```{r fig.width=7, fig.height=14}

这些称为本地组块选项,它将覆盖全局组块选项(临时针对此特定组块).

These are called local chunk options, which will override global chunk options (temporarily for this specific chunk).

更多推荐

opts

本文发布于:2023-10-18 13:01:18,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1504302.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:opts

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!