File tree 2 files changed +31
-23
lines changed
2 files changed +31
-23
lines changed Original file line number Diff line number Diff line change 8
8
#
9
9
10
10
library(shiny )
11
+ library(ggplot2 )
12
+
13
+ theme_set(theme_bw())
11
14
12
15
# Define server logic required to draw a histogram
13
16
shinyServer(function (input , output ) {
@@ -16,10 +19,15 @@ shinyServer(function(input, output) {
16
19
17
20
# generate bins based on input$bins from ui.R
18
21
x <- faithful [, 2 ]
19
- bins <- seq(min(x ), max(x ), length.out = input $ bins + 1 )
22
+ bins <- seq(min(x ), max(x ), length.out = 6 )
20
23
24
+ # This lets you stop the code and see what's in the environment
25
+ # browser()
26
+
21
27
# draw the histogram with the specified number of bins
22
- hist(x , breaks = bins , col = ' darkgray' , border = ' white' )
28
+
29
+ ggplot(faithful , aes(eruptions )) +
30
+ geom_histogram()
23
31
24
32
})
25
33
Original file line number Diff line number Diff line change 8
8
#
9
9
10
10
library(shiny )
11
+ library(shinydashboard )
11
12
12
13
# Define UI for application that draws a histogram
13
- shinyUI(fluidPage(
14
-
15
- # Application title
16
- titlePanel(" Old Faithful Geyser Data" ),
17
-
18
- # Sidebar with a slider input for number of bins
19
- sidebarLayout(
20
- sidebarPanel(
21
- sliderInput(" bins" ,
22
- " Number of bins:" ,
23
- min = 1 ,
24
- max = 50 ,
25
- value = 30 )
26
- ),
27
-
28
- # Show a plot of the generated distribution
29
- mainPanel(
30
- plotOutput(" distPlot" )
31
- )
32
- )
33
- ))
14
+ ui <- dashboardPage(
15
+
16
+ dashboardHeader(title = " COMPASS Synoptic" ),
17
+ dashboardSidebar(
18
+ sidebarMenu(
19
+ menuItem(" Dashboard" , tabName = " dashboard" , icon = icon(" compass" )),
20
+ menuItem(" Sapflow" , tabName = " sapflow" , icon = icon(" tree" )),
21
+ menuItem(" TEROS" , tabName = " teros" , icon = icon(" temperature-high" )),
22
+ menuItem(" AquaTroll" , tabName = " troll" , icon = icon(" water" )),
23
+ menuItem(" Battery" , tabName = " battery" , icon = icon(" car-battery" )),
24
+ menuItem(" Alerts" , tabName = " alerts" , icon = icon(" comment-dots" ))
25
+ )
26
+ ),
27
+ dashboardBody(
28
+ tabItem(tabName = " sapflow" ,
29
+ plotOutput(" distPlot" ))
30
+ ),
31
+ skin = " purple"
32
+
33
+ )
You can’t perform that action at this time.
0 commit comments