ABSTRACT

This chapter explains how to tune text output, including output from inline R code as well as text output from code chunks. The "text output" refers to any output from R that is not graphics, so even messages and warnings are classified as text output. For output, the package framed is used to decorate code chunks with a light gray background. The prompt characters are removed by default because they mangle the R source code in the output and make it difficult to copy R code. The R output is masked in comments by default based on the same rationale. If a code chunk has many short R expressions, and each expression prints some output, it will be disturbing to read the output because R each expression and output fragment occupies a separate visual block.