Shiny: Calibrate from flexdashboard in a Shiny app

Can I embed a sensor from a flexdashboard (Figure below) in a Shiny App ( shinydashboard or Shiny )?

enter image description here

Sample code in a Shiny flexdashboard with a flexdashboard website :

 ```{r} renderGauge({ rate <- computeContactRate(input$region) gauge(rate, min = 0, max = 100, symbol = '%', gaugeSectors( success = c(80, 100), warning = c(40, 79), danger = c(0, 39) )) }) ``` 

Here is my unsuccessful attempt:

 library(shiny) library(shinydashboard) #library(flexdashboard) ui <-dashboardPage( dashboardHeader(), dashboardSidebar(), dashboardBody( column(6,box(flexdashboard::gaugeOutput("plt1"),width=12,title="Gauge Graph",background ="green")))) server <- shinyServer(function(input, output, session) { output$plt1 <- flexdashboard::renderGauge({ gauge(56, min = 0, max = 100, symbol = '%', label = paste("Test Label"),gaugeSectors( success = c(100, 6), warning = c(5,1), danger = c(0, 1), colors = c("#CC6699") )) }) }) shinyApp(ui = ui, server = server) 

Thanks for any tips!

+3
shiny shinydashboard flexdashboard
source share
1 answer

(Solution sent on behalf of OP).

I forgot to remove # from #library(flexdashboard) , so I could not find the gauge function, and the calibration could not be displayed ...

+4
source share

All Articles