1

For code blocks that output more than once R Markdown breaks the code block up with the output eg.

```{r}
("one line")
("second line")
```

rendered markdown of problem

is there anyway to replicate the following output without having to duplicate the code block?

```{r, eval = FALSE}
("one line")
("second line")
```

```{r, echo = FALSE, collapse = TRUE}
("one line")
("second line")
```

rendered image of ideal outcome

camille
  • 15,634
  • 17
  • 33
  • 53
Lachlan
  • 33
  • 4

1 Answers1

1

You can use the results = "hold" argument in the chunk options.

```{r, results = "hold"}
("one line")
("second line")
```

enter image description here

Ritchie Sacramento
  • 22,522
  • 4
  • 39
  • 46