11.9 Collapse text output blocks into source blocks

If you feel there is too much spacing between text output blocks and source code blocks in the output, you may consider collapsing the text output into the source blocks with the chunk option collapse = TRUE. This is what the output looks like when collapse = TRUE:

1 + 1
## [1] 2
1:10
##  [1]  1  2  3  4  5  6  7  8  9 10

Below is the same chunk but it does not have the option collapse = TRUE (the default is FALSE):

1 + 1
## [1] 2
1:10
##  [1]  1  2  3  4  5  6  7  8  9 10