If you have designed a language engine, you may call this function in the end to format and return the text output from your engine.
A list of chunk options. Usually this is just the object
Source code of the chunk, to which the output hook
Text output from the engine, to which the hook
Any additional text output that you want to include.
For expert users, an advanced usage of this function is
engine_output(options, out = LIST) where
LIST is a list that
has the same structure as the output of
evaluate::evaluate(). In this
case, the arguments
extra are ignored, and the list is
passed to an internal function
knitr:::wrap() to return a character
vector of final output.
A character string generated from the source code and output using the appropriate output hooks.
1 2 3 4 5 6 7 8 9 10
library(knitr) engine_output(opts_chunk$merge(list(engine = "Rscript")), code = "1 + 1", out = " 2") engine_output(opts_chunk$merge(list(echo = FALSE, engine = "Rscript")), code = "1 + 1", out = " 2") # expert use only engine_output(opts_chunk$merge(list(engine = "python")), out = list(structure(list(src = "1 + 1"), class = "source"), "2"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.