在FlexDashboard中过滤。过滤选项不属于数据集

时间:2019-09-06 12:33:53

标签: r flexdashboard

我有一个运行完全正常的Flexdashboard代码。但是我在旁边有一个过滤器选项。单击“月”后,应该可以看到绘图。但是目前正在发生的事情是,一旦打开应用程序,便会显示绘图(这不应该发生)。但是这里的事情是过滤选项不是数据集的一部分

---
title: "Untitled"
source_code: embed
output:
  html_document:
    df_print: paged
  flexdashboard::flex_dashboard: null
  orientation: rows
vertical_layout:
  runtime: shiny
---

```{r global, include=FALSE}
library(flexdashboard)
library(readxl)
library(ggplot2)
library(reshape2)
library(flexdashboard)
df <- structure(list(A = structure(c(1L, 4L, 6L, 1L, 8L, 2L, 7L, 3L, 
                                     5L, 5L, 1L, 8L, 2L, 7L, 2L), .Label = c("asd", "dfg", "fgdsgd", 
                                                                             "fsd", "gdfgd", "gs", "sdfg", "sf"), class = "factor"), B = c(29L, 
                                                                                                                                           24L, 46L, 50L, 43L, 29L, 32L, 24L, 35L, 39L, 33L, 47L, 53L, 26L, 
                                                                                                                                           31L), C = structure(c(8L, 5L, 1L, 6L, 3L, 2L, 9L, 7L, 6L, 3L, 
                                                                                                                                                                 2L, 9L, 8L, 8L, 4L), .Label = c("asd", "er", "fg", "gf", "gfd", 
                                                                                                                                                                                                 "gfg", "qw", "sf", "tr"), class = "factor"), D = c(36L, 56L, 
                                                                                                                                                                                                                                                    39L, 26L, 56L, 35L, 27L, 31L, 33L, 45L, 34L, 27L, 43L, 40L, 56L
                                                                                                                                                                                                 ), E = structure(c(9L, 4L, 3L, 4L, 2L, 7L, 10L, 8L, 6L, 2L, 1L, 
                                                                                                                                                                                                                    10L, 9L, 9L, 5L), .Label = c("er", "fg", "g", "gd", "gf", "gfg", 
                                                                                                                                                                                                                                                 "gtd", "qw", "sf", "tr"), class = "factor"), F = c(44L, 34L, 
                                                                                                                                                                                                                                                                                                    37L, 23L, 37L, 51L, 28L, 36L, 33L, 31L, 39L, 43L, 25L, 37L, 43L
                                                                                                                                                                                                                                                 ), num = 1:15), row.names = c(NA, -15L), class = "data.frame")
```

Summary {data-width=650}
==========

                                                                                                                                                                                                                                                Month/Day {.sidebar}
-------------------
```{r}
selectInput("Interval","Intervals",choices =                      
              c("","Day","Month","Weekly","Hourly"))
```

Row
----------

### B Value

```{r}
gauge(paste(sum(df$B)),min = 0,max = 1000)
```

### D Value

```{r}
gauge(paste(sum(df$D)),min = 0,max = 1000)
```

0 个答案:

没有答案