6

Text Output

From this chapter forward, we will start touching on the chunk options in knitr. First, in this chapter, we explain how to tune text output, including output from inline R code as well as text output from code chunks.

6.1    Inline Output

If the inline R code produces character results, they will be directly written into the output. When the result is numeric, scientific notation will be considered to denote the numbers that are too big or too small.

The threshold between scientific notation and fixed notation is the R option scipen (see ?options for details). By default (scipen = 0), if a positive number is bigger than 104 or smaller than 10−4 (this applies to the absolute values of negative numbers too), it will be denoted ...

Get Dynamic Documents with R and knitr, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.