Creates an object of the class with_flair

decorate_code(text, ...)

Arguments

text

A string, presumably representing R code.

...

Any number of default chunk options to override.

Value

A with_flair object.

See also

Examples

# When run in console, this will print the results of mean(1:10) my_code <- decorate_code(text = 'mean(1:10)') %>% flair_funs()
#> [1] 5.5
# The object itself, when printed, previews your code with flair if (FALSE) { my_code } # Objects defined by decorate_code are created in the current environment for later use. my_code <- decorate_code('foo <- mean(1:10)')
#> [1] 5.5
foo + 5
#> [1] 10.5