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
当前内容版权归 Chapman & Hall/CRC 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 Chapman & Hall/CRC .