Commit 043f6b13 authored by Stephanie's avatar Stephanie
Browse files

now working settup

parent 2df58055
...@@ -9,21 +9,6 @@ ...@@ -9,21 +9,6 @@
library(shiny) library(shiny)
# Define server logic required to draw a histogram server <- function(input, output) {
shinyServer(function(input, output) { set.seed(122)
output$distPlot <- renderPlot({
# generate bins based on input$bins from ui.R
x <- faithful[, 2]
bins <- seq(min(x), max(x), length.out = input$bins + 1)
# draw the histogram with the specified number of bins
hist(x, breaks = bins, col = 'darkgray', border = 'white')
})
} }
)
...@@ -3,7 +3,7 @@ library(shiny) ...@@ -3,7 +3,7 @@ library(shiny)
library(shinydashboard) library(shinydashboard)
library(leaflet) library(leaflet)
ui<-dashboardPage( ui <- dashboardPage(
dashboardHeader(title="CoCoVisR"), dashboardHeader(title="CoCoVisR"),
dashboardSidebar( dashboardSidebar(
sidebarMenu( sidebarMenu(
...@@ -30,9 +30,8 @@ ui<-dashboardPage( ...@@ -30,9 +30,8 @@ ui<-dashboardPage(
h2("This is the Dashboard"), h2("This is the Dashboard"),
fluidRow( fluidRow(
box( title="Histogram", box( title="Histogram",
#background="maroon", status = "primary",
solidHeader = TRUE, solidHeader = TRUE,
collapsible = TRUE, collapsible = TRUE,
plotOutput("plot1", height = 250)), plotOutput("plot1", height = 250)),
box(title="Map", box(title="Map",
...@@ -40,8 +39,14 @@ ui<-dashboardPage( ...@@ -40,8 +39,14 @@ ui<-dashboardPage(
solidHeader = TRUE, solidHeader = TRUE,
collapsible = TRUE, collapsible = TRUE,
plotOutput("plot1", height = 250)), plotOutput("plot1", height = 250)),
box(plotOutput("plot3", height = 250)), box(title="Timeline",
box(plotOutput("plot4", height = 250)) status = "primary",
solidHeader = TRUE,
collapsible = TRUE,plotOutput("plot3", height = 250)),
box(title="Linechart",
status = "primary",
solidHeader = TRUE,
collapsible = TRUE,plotOutput("plot4", height = 250))
#box( #box(
# title = "Controls", # title = "Controls",
#sliderInput("slider", "Number of observations:", 1, 100, 50) #sliderInput("slider", "Number of observations:", 1, 100, 50)
...@@ -58,9 +63,9 @@ ui<-dashboardPage( ...@@ -58,9 +63,9 @@ ui<-dashboardPage(
)) ))
) )
server <- function(input, output) { #server <- function(input, output) {
set.seed(122) # set.seed(122)
histdata <- rnorm(500) #histdata <- rnorm(500)
#output$plot1 <- renderPlot({ #output$plot1 <- renderPlot({
#data <- histdata[seq_len(input$slider)] #data <- histdata[seq_len(input$slider)]
...@@ -76,5 +81,5 @@ server <- function(input, output) { ...@@ -76,5 +81,5 @@ server <- function(input, output) {
#m <- addMarkers(m,lng=longitude[x], lat=latitude[x]) #addPolylines does not work #m <- addMarkers(m,lng=longitude[x], lat=latitude[x]) #addPolylines does not work
#x=x+1} #x=x+1}
#m #m
} #}
shinyApp(ui,server) #shinyApp(ui, server)
#
# This is the server logic of a Shiny web application. You can run the
# application by clicking 'Run App' above.
#
# Find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com/
#
library(shiny)
# Define server logic required to draw a histogram
server(function(input, output) {
output$distPlot <- renderPlot({
# generate bins based on input$bins from ui.R
x <- faithful[, 2]
bins <- seq(min(x), max(x), length.out = input$bins + 1)
# draw the histogram with the specified number of bins
hist(x, breaks = bins, col = 'darkgray', border = 'white')
})
})
#
# This is the user-interface definition of a Shiny web application. You can
# run the application by clicking 'Run App' above.
#
# Find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com/
#
library(shiny)
# Define UI for application that draws a histogram
shinyUI(fillPage(
# Application title
titlePanel("Old Faithful Geyser Data"),
# Sidebar with a slider input for number of bins
sidebarLayout(
sidebarPanel(
sliderInput("bins",
"Number of bins:",
min = 1,
max = 50,
value = 30)
),
# Show a plot of the generated distribution
mainPanel(
plotOutput("distPlot")
)
)
))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment