Skip to contents

Determines the output type as print() does, in this order: the output_type argument; getOption("r8.output_type"); the environment variable R8_OUTPUT_TYPE; "plain" when NO_COLOR is set or knitr runs; "ansi" in Positron, in RStudio with console color, and when standard output is a terminal, other than in R.app and Rgui; "plain" otherwise. Inside a running print() of an R8 value or text, it returns that call's output type, so a Print impl that writes with cat() writes the type the call determined.

Usage

r8output_type(output_type = NULL)

Arguments

output_type

Character or NULL: "plain", "ansi", "html", or "markdown".

Value

Character: The output type.

Author

EDG

Examples

r8output_type()
#> [1] "plain"
r8output_type("html")
#> [1] "html"