I have the following conceptual question: How to render data inside a fluidPage. Here is the code that resumes the question:
---
title: "Dashboard"
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
runtime: shiny
---
library(flexdashboard)
library(DBI)
library(RPostgreSQL)
library(tidyverse)
library(DT)
dataset <- eventReactive(input$button_execute, {
# SQL query
dataset <- dbFetch(rs)
})
So far the query runs fine, and I want to put some results of the query inside a fluidPage:
fluidPage(
fluidRow(
column(2,""),
column(8,variable1, style="text-align: center;")),
column(2,variable2, style="text-align: center;"))
)
)
I want variable 1 and 2 to be:
variable1 <- dataset %>% summary(total = sum(sales))
variable2 <- dataset %>% summary(mean = sum(sales))
Could you please help me with some advice on this? Thank you.