Tôi đã thêm nút tải xuống vào bảng flexdashboard trong bảng điều khiển bên cạnh, nhưng nó xuất hiện trong bảng chính khi tôi đan .RMD. Bạn có thể hướng dẫn tôi như thế nào để tôi có thể sửa chữa nó?Cách khắc phục sự cố thanh bên của nút tải xuống trong bảng mạch linh hoạt
Dưới đây là một ví dụ nhỏ về những gì tôi đang cố gắng để hoàn thành
---
title: "Download Button in Wrong Panel"
output:
flexdashboard::flex_dashboard:
vertical_layout: scroll
runtime: shiny
---
```{r setup, include=FALSE}
## Setting up required libraries
library(flexdashboard)
library(dplyr)
library(shiny)
library(knitr)
dataset <- read.csv(somefile)
```
Inputs {.sidebar}
-----------------------------------------------------------------------
### Input Filters
```{r input}
## Metric 1
selectInput('metric',
'Choose Metric',
names(dataset %>% select(-default_column)),
selected = "default_metric")
## Download Button
downloadButton('downloadData','Download Result Set')
```
Outputs
-----------------------------------------------------------------------
### List of Customers
```{r output}
subset_dataset <- reactive({
dataset[,c("default_column",input$metric)]
})
renderTable({
subset_dataset()
},
include.rownames = FALSE)
downloadHandler(filename = function() {
paste('resultset-', Sys.Date(), '.csv', sep='')
},
content = function(file) {
write.csv(subset_dataset(), file, row.names = FALSE)
}
)
```
Một ảnh chụp màn hình của bảng điều khiển như sau
Cảm ơn!