Parameters 将反应传递给flexdashboard

Parameters 将反应传递给flexdashboard,parameters,shiny,reactive,flexdashboard,Parameters,Shiny,Reactive,Flexdashboard,我有一个大型闪亮的应用程序,我想提供导出flexdashboard报告的可能性。因此,我添加了一个downloadHandler,它将某些参数传递给flexdashboard。flexdashboard本身应该在不部署到服务器上的情况下工作,因此我不使用runtime:shinny选项 如何将反应值传递到flexdashboard?如果我执行类似于params的操作,我发现了问题所在:我想要传递给flexdashboard的反应在创建报告时没有正确创建,这导致报告创建中断。。。 传递反应与报告数

我有一个大型闪亮的应用程序,我想提供导出flexdashboard报告的可能性。因此,我添加了一个downloadHandler,它将某些参数传递给flexdashboard。flexdashboard本身应该在不部署到服务器上的情况下工作,因此我不使用
runtime:shinny
选项


如何将反应值传递到flexdashboard?如果我执行类似于
params的操作,我发现了问题所在:我想要传递给flexdashboard的反应在创建报告时没有正确创建,这导致报告创建中断。。。
传递反应与报告数据的方式完全相同。帧:

params我发现了问题所在:我想要传递给flexdashboard的反应在创建报告时没有正确创建,这导致报告创建中断。。。
传递反应与报告数据的方式完全相同。帧:
params
test <- reactive({
    [[SOME STUFF]]
})

output$report <- downloadHandler(
  # For PDF output, change this to "report.pdf"
  filename = "report.html",
  content = function(file) {

    # Copy the report file to a temporary directory before processing it, in
    # case we don't have write permissions to the current working dir (which
    # can happen when deployed).
    tempReport <- file.path(tempdir(), "report.Rmd")
    file.copy("report.Rmd", tempReport, overwrite = TRUE)

    # Set up parameters to pass to Rmd document
    params <- list(y = test())

    # Knit the document, passing in the `params` list, and eval it in a
    # child of the global environment (this isolates the code in the document
    # from the code in this app).
    rmarkdown::render(tempReport, output_file = file,
                      params = params,
                      envir = new.env(parent = globalenv())
    )
  }
)
---
title: "Row Orientation"
output: 
  flexdashboard::flex_dashboard:
    orientation: rows
params:
  y: NA
---

```{r setup, include=FALSE}
library(flexdashboard)
library(ggiraph)
library(ggplot2)
library(magrittr)
```
Row
-------------------------------------

### Chart 1

```{r}
ggplot(params$y)
```