Hi,
I am unable fit in two output tableoutput and a plotoutput into a single dashboard. when I am outputing only Plotoutput then it is working fine but when I am trying to make both the output together then Tableoutput is appearing well but plotoutput is not appearing.
Please find my code below:
query_detail <- read_excel("Query Detail.xls")
# Define UI for application that draws a histogram
ui <- fluidPage(
# Application title
titlePanel("Queries Dashboard"),
dashboardSidebar(
sidebarPanel(
sliderInput("bins",
"Number of bins:",
min = 1,
max = 20,
value = 10)
),
dashboardBody(
fluidRow(box(plotOutput("distPlot"))),
fluidRow(box(tableOutput("QueryDetail")))
)
)
)
server <- function(input, output) {
output$distPlot <- renderPlot({
query_detail %>% filter(`Query Text` != "The field is required. Please complete.") %>%
group_by(Form, Field, `Query Text`) %>%
summarise(number_of_times = n()) %>% filter(number_of_times != 1) %>%
arrange(desc(number_of_times)) %>% ungroup() %>%
mutate(Check_order_ID = row_number()) %>%
filter(number_of_times >= input$bins) %>%
ggplot(aes(x= Check_order_ID, y=number_of_times, fill=Field), height = 50, width = 200) +
geom_bar(stat="identity", position=position_dodge()) + facet_wrap(~Form) +
theme(axis.text = element_text(size = 10))
output$QueryDetail <- function(){
query_detail %>% filter(`Query Text` != "The field is required. Please complete.") %>%
group_by(Form, Field, `Query Text`) %>%
summarise(number_of_times = n()) %>% filter(number_of_times != 1) %>%
arrange(desc(number_of_times)) %>% ungroup() %>%
mutate(Check_order_ID = row_number()) %>%
filter(number_of_times >= input$bins) %>% kable() %>% kable_styling() %>% scroll_box(height = "100px", width = "800px")
}
})
}