decorate_code: Creates an object of the class 'decorated'

View source: R/decorate_code.R

decorate_codeR Documentation

Creates an object of the class decorated

Description

Creates an object of the class decorated

Usage

decorate_code(text, ...)

Arguments

text

A string, presumably representing R code.

...

Any number of default chunk options to override.

Value

A decorated object.

See Also

flair

Examples


# When run in console, this will print the results of mean(1:10)
my_code <- decorate_code(text = 'mean(1:10)') %>% flair_funs()

# The object itself, when printed, previews your code with flair

my_code


# Objects defined by decorate_code are created in the current environment for later use.

my_code <- decorate_code('foo <- mean(1:10)')

foo + 5


kbodwin/flair documentation built on Feb. 6, 2023, 4:24 p.m.