【发布时间】:2021-02-24 20:35:47
【问题描述】:
如果我直接打开文件并单击 R Studio 中的运行文档,我有一个闪亮的 flexdashboard,它运行良好,但是我正在尝试设置一个 R 脚本来运行仪表板。该脚本将找到降价文件并部分运行它,但一旦它到达output$something <- renderUI(...) 之类的内容时总是会抛出错误。错误是
Error in output$select_file <- renderUI({ : object 'output' not found
此问题的测试降价文件是:
---
title: "example"
author: "hamburglar"
output:
flexdashboard::flex_dashboard:
theme: yeti
orientation: rows
vertical_layout: fill
runtime: shiny
---
#```{r setup, include=FALSE}
library(flexdashboard)
library(tidyverse)
#```
Home
=======================================================================
Sidebar {.sidebar}
-----------------------------------------------------------------------
> These are some notes
#```{r}
data(iris)
data(cars)
data(CO2)
files <- list(iris=iris, cars=cars, CO2=CO2)
output$select_file <- renderUI({
selectInput(inputId='file_choice',
label='Choose File',
choices=names(files)
)
})
uiOutput("select_file")
#```
Row
-----------------------------------------------------------------------
### Data
#```{r}
renderTable({
files[[input$file_choice]]
})
#```
并且我尝试使用以下脚本获得相同的结果:
library(flexdashboard)
library(shiny)
library(rmarkdown)
render("path/test_board.Rmd",
#output_file="Dashboard.html"
#flex_dashboard()
#"flex_dashboard"
)
对于path,我尝试了共享驱动器路径和我的桌面,我尝试了许多不同的参数,我读过这些参数会让渲染函数知道制作一个 flaexdashboard(在渲染中的 cmets功能)。在我所有的尝试中,我都收到错误消息,指出找不到 output 对象。如果有人能提供任何帮助,我将不胜感激。
【问题讨论】:
标签: r shiny flexdashboard