mirror of
https://github.com/rstudio/shiny.git
synced 2026-02-18 02:21:41 -05:00
Implement Shiny apps embedded as iframes in knitr
This commit is contained in:
23
inst/rmd-examples/subapps.Rmd
Normal file
23
inst/rmd-examples/subapps.Rmd
Normal file
@@ -0,0 +1,23 @@
|
||||
# Subapp test
|
||||
|
||||
This is an R Markdown document that contains several embedded Shiny apps.
|
||||
|
||||
```{r}
|
||||
library(shiny)
|
||||
shinyAppDir(
|
||||
system.file("examples/01_hello", package="shiny"),
|
||||
options=list(
|
||||
width="100%", height=250
|
||||
)
|
||||
)
|
||||
shinyAppObj(
|
||||
ui = fluidPage(
|
||||
numericInput("n", "n", 1),
|
||||
plotOutput("plot")
|
||||
),
|
||||
server = function(input, output) {
|
||||
output$plot <- renderPlot( plot(head(cars, input$n)) )
|
||||
},
|
||||
options=list(width=450)
|
||||
)
|
||||
```
|
||||
Reference in New Issue
Block a user