How to embed an interactive shiny plot in a pdf / presentation? (via knitR maybe)

安稳与你 提交于 2019-12-07 16:16:54

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!