Style text

style_text(text, configuration = list())

Arguments

text

(character) the text to style

configuration

(list) Configuration for formatting. Default list().

Value

(character) the text formatted as R code

Details

This function is vectorized. To see possible configuration options, see get_default_config().

Examples

code <- "function(){}"
style_text(code)
#> [1] "function() {}\n"

code <- c("function(){}", "A<-7")
style_text(code)
#> [1] "function() {}\n" "A <- 7\n"