防止展开代码/功能出现r-markdown

问题描述 投票:0回答:1

这是我的r-markdown代码:

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

test_funciton <- function(){<->}

3+5

```

观察到test_function被折叠。现在,当我执行3+5行时,最终得到以下视图:

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

test_funciton <- function(){
  print('test')
}

3+5

```

test_function现在展开。我想知道我是否可以防止这种行为?

r r-markdown folding
1个回答
1
投票

您尝试过this answer吗?我尝试在RStudio v1.2.5033中重现您的问题,它对我有用。


工具>全局选项> R Markdown> 取消选中:显示所有R Markdown文档的内联输出。

在编辑R Markdown文档时,应禁用内联代码块输出。那能满足您的要求吗?


© www.soinside.com 2019 - 2024. All rights reserved.