Creates an object of the class with_flair
decorate_code(text, ...)
text | A string, presumably representing R code. |
---|---|
... | Any number of default chunk options to override. |
A with_flair
object.
# 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.5foo + 5#> [1] 10.5