问题
As the topic implies I am looking for a way to combine interactive shiny plots with knitr´s way of producing presentations/pdfs. The following intuitive approach should make my idea comprehensible.
---
title: "Test"
runtime: shiny
output:
pdf_document
---
```{r}
library(shiny)
library(knitr)
library(rmarkdown)
sliderInput("bins",
"Choose Standard Deviation:",
min = 0,
max = 2,
value = 1,
step = 0.1)
sliderInput("length",
"Choose Length of Process:",
min = 100,
max = 10000,
value = 1000,
step = 100)
renderPlot({
#create a random walk
set.seed(12)
y <- cumsum(rnorm(input$length,0,input$bins))
plot(y, type="l")
})
```
I know it´s not a big deal to get that code into a html document, but is there a way to get the exact same thing (or at least close to that) in a pdf document? So I want a pdf file with aN interactive plot. Is that somehow possible? Many thanks in adavance :)
回答1:
The comment from HubertL is basically the answer: it is not possible.
来源:https://stackoverflow.com/questions/42561714/how-to-embed-an-interactive-shiny-plot-in-a-pdf-presentation-via-knitr-maybe