【发布时间】:2020-12-09 10:32:40
【问题描述】:
我正在尝试在闪亮的应用程序中使用 quantmod 绘制股票折线图。 收到错误。 警告:sourceUTF8 中的错误:错误采购 /home/ccc_v1_w_62aa8_36923/asn122362_7/asn122367_1/Dashboard 4Dec/9 Dec Stock APP TESTING/Testing Stock App/server.R [没有可用的堆栈跟踪] sourceUTF8(serverR, envir = new.env(parent = sharedEnv)) 中的错误:
Server.R
library(quantmod)
shinyServer(function(input, output){
price <- getSymbols(input$stockInput,
type="line",
from='2019',
theme=chartTheme('white'),
auto.assign = F)
plot(price, main = input$stockInput)})
ui.R
library(shiny)
shinyUI(fluidPage(
titlePanel("Stock Chart"),
sidebarLayout(
sidebarPanel(
#This is a dropdown to select the stock
selectInput("stockInput",
"Pick your stock:",
c("AMZN","FB","GOOG","NVDA","AAPL"),
"AMZN"),selected = "GOOG"),
# Show a plot of the generated distribution
mainPanel(
plotOutput("distPlot")
))))
【问题讨论】:
-
getSymbol崩溃了,您也无法使用此功能获取价格数据... -
谢谢。有什么建议吗?