highlight: Syntax highlight R code

View source: R/highlight.R

highlightR Documentation

Syntax highlight R code

Description

Syntax highlight R code

Usage

highlight(code, style = default_style())

Arguments

code

Character vector, each element is one line of code.

style

Style functions, see default_style().

Value

Character vector, the highlighted code.

Examples

highlight(deparse(ls))
cat(highlight(deparse(ls)), sep = "\n")

r-lib/prettycode documentation built on Nov. 10, 2023, 1:45 a.m.