Description Usage Arguments Examples
These functions work similar to renderText
and verbatimTextOutput
but
will include highlighting with highlight.js
and rstudio.css
.
1 2 3 4 | renderCode(expr, env = parent.frame(), quoted = FALSE,
outputArgs = list(), delay = 100)
codeOutput(outputId)
|
expr |
An expression that returns an R object that can be used as an
argument to |
env |
The environment in which to evaluate |
quoted |
Is |
outputArgs |
A list of arguments to be passed through to the implicit
call to codeOutput when |
delay |
How much delay to use (in ms) between rendering and firing the
syntax highlighting script. For |
outputId |
output variable to read the code from. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## Not run:
shinyApp(
fluidPage(
textAreaInput("code_in", NULL, width = "1000px", height = "200px",
paste("f <- function(x) {2*x + 3}", "f(1)", "#> 5", sep = "\n")),
codeOutput("code_out")
),
function(input, output, session){
output$code_out <- renderCode({
paste(input$code_in)
})
}
)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.