如何在pdf/演示文稿中嵌入交互式闪亮图? (也许通过knitR) [英] How to embed an interactive shiny plot in a pdf / presentation? (via knitR maybe)

查看:63
本文介绍了如何在pdf/演示文稿中嵌入交互式闪亮图? (也许通过knitR)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如该主题所暗示的那样,我正在寻找一种将交互式闪亮图与knitr生成演示文稿/pdfs的方式相结合的方法. 以下直观的方法应该使我的想法容易理解.

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") 
 })

```

我知道将代码放入html文档中没什么大不了,但是有没有办法在pdf文档中获得完全相同的东西(或至少接近它)? 所以我想要一个带有aN交互式图的pdf文件.有可能吗? 非常感谢:)

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 :)

推荐答案

HubertL的评论基本上是答案:不可能.

The comment from HubertL is basically the answer: it is not possible.

这篇关于如何在pdf/演示文稿中嵌入交互式闪亮图? (也许通过knitR)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆