Hello I am new to r shiny I am trying to create an app that plots stocks from quantmod in r
like this
this is the code I have
library(shiny)
server = function(input, output, session) {
output$plot <- renderPlot({
data <- getSymbols(input$stock,
from = input$date[1],
to = input$date[2]
)
chartSeries(data, theme = chartTheme("white"),
type = "line", log.scale = input$log, TA = NULL)
})
} # the server
ui = basicPage(
h1("stock app"),
textInput("stocks", "pick stock"),
dateRangeInput("date", "date range ", start = "2013-01-01", end = "2020-03-15",min = "2007-01-01", max = "2020-03-15",format = "yyyy-mm-dd" ),
plotOutput("plot")
) # the user interface
shinyApp(ui = ui, server = server) # perform app launch
however instead of plotting the stock series my app is returning an error like this
Error: chartSeries requires an xtsible object.
I would like to know why my application does not plot the stock in my input