highlight: Highlights parts of a string

Description Usage Arguments Value Examples

Description

hlt_* returns an string of R code with formatting wrappers (currently only html)

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
hlt_regexp(.string, pattern, code = TRUE, ...)

hlt_quick(.string, pattern, ...)

hlt_all(.string, ...)

hlt_fixed(.string, pattern, ...)

hlt_args(.string, ...)

hlt_funs(.string, ...)

hlt_input_vals(.string, ...)

Arguments

.string

A string object

pattern

A regular expression to match

code

Should this string be displayed in R code format?

...

Formatting options, passed to txt_style

hlt_color

Color to highlight code with. Defaults to

Value

A string with formatting wrappers.

Examples

1
2
3
4
5
6
7
code_string <- "foo <- mean(1:10, na.rm = TRUE)"

code_string %>% hlt_args()

code_string %>% hlt_funs(color = "red")

code_string %>% hlt_regexp("foo")

kbodwin/demoR documentation built on Nov. 10, 2019, 11:30 p.m.