Here is the entire code of less than 15 lines to get the Shiny server working, you can paste it into a markdown document and compile with knitr in Rstudio environment.
library(quantmod)
stock.env <- new.env()
inputPanel(
textInput("symbol", label = "Enter Valid Stock Symbol: ", value="INTC", placeholder = "Ex: MSFT or GOOG or AMZN"),
sliderInput("date_range", "Choose Date Range:", min = as.Date("2007-01-03"), max = Sys.Date(),
step = 1, value = c(as.Date("2007-01-03"), Sys.Date()))
)
renderPlot({
getSymbols(input$symbol, src="yahoo", env = stock.env, from = as.Date(input$date_range[1]), to = as.Date(input$date_range[2]) )
symbol.data <- get(input$symbol, envir = stock.env)
chartSeries(symbol.data)
})