Rafael MartÃnez MartÃnez
2019-February-04
An application is generated in Shiny, using the quantmod package to visualize the shares of the American stock exchange of the companies shown on the right. The data is extracted from yahoo, these data are from 2019-01-01 to 2019-02-04. The application can be found in the following link
The codes ui.R and server.R can be found in the following link of github, we show the code in the next slides
library(shiny)
# Define UI for application that draws a histogram
shinyUI(fluidPage(
titlePanel("Shares in American Stock market"),
sidebarLayout(
sidebarPanel(
p("You can view the shares in the American stock
exchange of the different companies available from the
beginning of the year 2019 until 2019-02-04, the data
is extracted from yahoo. The code u1.r and server.R
are in the following link",
style = "font-family: 'times'; font-si16pt"),
tags$div(
tags$a(href="https://github.com/rafneta/DevelopingDataProducts",
target = "_blank","Github Repository")),
br(),
selectInput("Share",
label = "Share",choices = c("Apple"= "AAPL", "CISCO"= "CSCO",
"IBM"= "IBM", "Facebook" = "FB", "Twitter" = "TWTR", "Microsoft" ="MSFT","Google" = "GOOG"))),
mainPanel("Shares in American Stock market",
plotOutput("grafico") ))))
library(shiny)
library(quantmod)
# Define server logic required to draw a histogram
shinyServer(function(input, output) {
output$grafico <- renderPlot({
stockdata <- getSymbols(input$Share, src = "yahoo",
from = "2019-01-01", to = "2019-02-04",
auto.assign = FALSE)
candleChart(stockdata, name = input$Share)
})})