Skip to content

Instantly share code, notes, and snippets.

@BernardOng
Last active August 4, 2016 17:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BernardOng/15779a6886db13ac3e6e09a3bed4d01c to your computer and use it in GitHub Desktop.
Save BernardOng/15779a6886db13ac3e6e09a3bed4d01c to your computer and use it in GitHub Desktop.
# -----------------------------------------------------------
# Dashboard Header
# -----------------------------------------------------------
header <- dashboardHeader(
title = "Bubo Stock Analyzer",
# titleWidth = 200, # --> only if needed later
disable = FALSE
)
# -----------------------------------------------------------
# Dashboard Sidebar
# -----------------------------------------------------------
sidebar <- dashboardSidebar(
# width = 200, # --> only if needed - need to make this same as the header width
# Input the stock or index symbol here - convert to upper case
textInput("sname", "Enter Stock/Index Symbol:", value = "^GSPC", width="100%"),
# radio buttons to choose between Adjusted Closing Price or Transaction Volume
radioButtons("sparm", "Select Stock/Index Data:",
c("Adjusted Closing Price" = "Adjusted",
"Transaction Volume" = "Volume"),
width = "100%"
),
#hr(),
# dropdown menu to choose between:
# Max Temp, Max Hum, Max Wind, Cloud Cover (oktas 0-8), Max Visibility and Rain
selectInput("wparm", "Select Weather Data:",
c("Max Temperature (F)" = "MaxTemp",
"Max Humidity (%)" = "MaxHum",
"Max Wind Velocity (mph)" = "MaxWind",
"Max Visibility (mi)" = "MaxVis",
"Cloud Cover (oktas)" = "Cloud",
"Rain (in)" = "Rain"),
width = "100%"
),
#hr(),
# Date range selector, with earliest 2013-01-01, and latest 2015-12-31
dateRangeInput("drange", "Choose Date Range:",
start = "2013-01-01",
end = "2015-12-31",
min = "2013-01-01",
max = "2015-12-31",
format = "yyyy-mm-dd",
width = "100%"
),
br(), br(),
div(img(src="bubo.png"),style="text-align:center;")
)
# -----------------------------------------------------------
# Dashboard Body
# -----------------------------------------------------------
body <- dashboardBody(
fluidRow(
column(width=12,
# Put content here on this row, taking all of 12 columns
tabBox(
title = "by Bernard Ong",
# The id lets us use input$tabset1 on the server to find the current tab
id = "tabset1", height = "100%", width = "100%",
# Tab 1 ---------------------------------------------
tabPanel(strong("TRENDING"),
box(
width = "100%",
heigth = "100%",
title = "Time Series Charts",
status = "primary",
solidHeader = TRUE,
dygraphOutput("dygraph1",height="600")
)
),
# Tab 2 ---------------------------------------------
tabPanel(strong("CORRELATOR"),
box(
width = "100%",
heigth = "100%",
infoBox("Pearson",textOutput("psCorr"),icon=icon("list"),color="aqua"),
infoBox("Kendall",textOutput("kdCorr"),icon=icon("list"),color="purple"),
infoBox("Spearman",textOutput("smCorr"),icon=icon("list"),color="yellow")
),
box(
width = "100%",
height = "100%",
title = "Scatter Plots",
status = "success",
solidHeader = TRUE,
plotOutput("plot1")
)
)
)
)
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment