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
  • 16,432
  • 18
  • 38
  • 60
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
  • 29,890
  • 4
  • 48
  • 56