- 阅读权限
- 255
- 威望
- 0 级
- 论坛币
- 4297 个
- 通用积分
- 6.6800
- 学术水平
- 10 点
- 热心指数
- 17 点
- 信用等级
- 13 点
- 经验
- 565 点
- 帖子
- 730
- 精华
- 0
- 在线时间
- 2236 小时
- 注册时间
- 2009-5-26
- 最后登录
- 2021-12-29
已卖:4082份资源
教授
还不是VIP/贵宾
- 威望
- 0 级
- 论坛币
 - 4297 个
- 通用积分
- 6.6800
- 学术水平
- 10 点
- 热心指数
- 17 点
- 信用等级
- 13 点
- 经验
- 565 点
- 帖子
- 730
- 精华
- 0
- 在线时间
- 2236 小时
- 注册时间
- 2009-5-26
- 最后登录
- 2021-12-29
 | 开心 2020-3-25 03:05:43 |
|---|
签到天数: 189 天 连续签到: 1 天 [LV.7]常住居民III
|
100论坛币
|
刚写出来一个trading strategy的策略,很简单的策略,然后再Rstudio里面测试没问题,最后决定放到自己的ShinyApps.io上面。
Deloy的时候是成功了的,但是自动打开的页面立马变成灰色,然后LOG里面出现:
- APPLICATION / LOGS
- 2014-11-30T06:11:15.265031+00:00 shinyapps[shuttle]: Shiny version: 0.10.2.1
- 2014-11-30T06:11:15.266635+00:00 shinyapps[shuttle]: knitr version: 0.0.0
- 2014-11-30T06:11:15.264968+00:00 shinyapps[shuttle]: R version: 3.1.1
- 2014-11-30T06:11:15.266205+00:00 shinyapps[shuttle]: rmarkdown version: 0.0.0
- 2014-11-30T06:11:15.565324+00:00 shinyapps[shuttle]:
- 2014-11-30T06:11:15.565329+00:00 shinyapps[shuttle]: Starting Shiny with process ID: '12'
- 2014-11-30T06:11:15.572858+00:00 shinyapps[shuttle]:
- 2014-11-30T06:11:15.572860+00:00 shinyapps[shuttle]: Listening on http://0.0.0.0:52221
- 2014-11-30T06:11:23.729778+00:00 shinyapps[shuttle]: R version: 3.1.1
- 2014-11-30T06:11:23.730948+00:00 shinyapps[shuttle]: rmarkdown version: 0.0.0
- 2014-11-30T06:11:23.729822+00:00 shinyapps[shuttle]: Shiny version: 0.10.2.1
- 2014-11-30T06:11:23.731358+00:00 shinyapps[shuttle]: knitr version: 0.0.0
- 2014-11-30T06:11:23.996347+00:00 shinyapps[shuttle]:
- 2014-11-30T06:11:23.996350+00:00 shinyapps[shuttle]: Starting Shiny with process ID: '25'
- 2014-11-30T06:11:24.003787+00:00 shinyapps[shuttle]:
- 2014-11-30T06:11:24.003790+00:00 shinyapps[shuttle]: Listening on http://0.0.0.0:45894
- 2014-11-30T06:11:25.026523+00:00 shinyapps[shuttle]: Error in eval(expr, envir, enclos) : could not find function "getSymbols"
- 2014-11-30T06:17:02.722512+00:00 shinyapps[shuttle]: Shiny version: 0.10.2.1
- 2014-11-30T06:17:02.724119+00:00 shinyapps[shuttle]: knitr version: 0.0.0
- 2014-11-30T06:17:02.722449+00:00 shinyapps[shuttle]: R version: 3.1.1
- 2014-11-30T06:17:02.723658+00:00 shinyapps[shuttle]: rmarkdown version: 0.0.0
- 2014-11-30T06:17:03.084402+00:00 shinyapps[shuttle]:
- 2014-11-30T06:17:03.084407+00:00 shinyapps[shuttle]: Starting Shiny with process ID: '12'
- 2014-11-30T06:17:03.091636+00:00 shinyapps[shuttle]:
- 2014-11-30T06:17:03.091638+00:00 shinyapps[shuttle]: Listening on http://0.0.0.0:34012
- 2014-11-30T06:17:14.505992+00:00 shinyapps[shuttle]: R version: 3.1.1
- 2014-11-30T06:17:14.507932+00:00 shinyapps[shuttle]: rmarkdown version: 0.0.0
- 2014-11-30T06:17:14.506041+00:00 shinyapps[shuttle]: Shiny version: 0.10.2.1
- 2014-11-30T06:17:14.508543+00:00 shinyapps[shuttle]: knitr version: 0.0.0
- 2014-11-30T06:17:14.956255+00:00 shinyapps[shuttle]:
- 2014-11-30T06:17:14.956260+00:00 shinyapps[shuttle]: Starting Shiny with process ID: '25'
- 2014-11-30T06:17:14.967268+00:00 shinyapps[shuttle]:
- 2014-11-30T06:17:14.967270+00:00 shinyapps[shuttle]: Listening on http://0.0.0.0:41123
- 2014-11-30T06:17:16.000644+00:00 shinyapps[shuttle]: Error in eval(expr, envir, enclos) : could not find function "getSymbols"
- 2014-11-30T16:20:24.231057+00:00 shinyapps[shuttle]: R version: 3.1.1
- 2014-11-30T16:20:24.232354+00:00 shinyapps[shuttle]: rmarkdown version: 0.0.0
- 2014-11-30T16:20:24.231109+00:00 shinyapps[shuttle]: Shiny version: 0.10.2.1
- 2014-11-30T16:20:24.232847+00:00 shinyapps[shuttle]: knitr version: 0.0.0
- 2014-11-30T16:20:24.509784+00:00 shinyapps[shuttle]:
- 2014-11-30T16:20:24.509786+00:00 shinyapps[shuttle]: Starting Shiny with process ID: '12'
- 2014-11-30T16:20:24.516785+00:00 shinyapps[shuttle]:
- 2014-11-30T16:20:24.516788+00:00 shinyapps[shuttle]: Listening on http://0.0.0.0:34484
- 2014-11-30T16:20:32.308635+00:00 shinyapps[shuttle]: R version: 3.1.1
- 2014-11-30T16:20:32.309765+00:00 shinyapps[shuttle]: rmarkdown version: 0.0.0
- 2014-11-30T16:20:32.308719+00:00 shinyapps[shuttle]: Shiny version: 0.10.2.1
- 2014-11-30T16:20:32.310189+00:00 shinyapps[shuttle]: knitr version: 0.0.0
- 2014-11-30T16:20:32.568862+00:00 shinyapps[shuttle]:
- 2014-11-30T16:20:32.568864+00:00 shinyapps[shuttle]: Starting Shiny with process ID: '25'
- 2014-11-30T16:20:32.575670+00:00 shinyapps[shuttle]:
- 2014-11-30T16:20:32.575673+00:00 shinyapps[shuttle]: Listening on http://0.0.0.0:37672
- 2014-11-30T16:20:33.662805+00:00 shinyapps[shuttle]: Error in eval(expr, envir, enclos) : could not find function "getSymbols"
复制代码 [size=13.63636302948px]我的server.R里面source了几个function,而且quantmod里面的这个getsymbols是在那几个source的function里面,不在server.R里面,我不知道是不是这里出了问题。下面贴出我的部分代码,抱歉由于代码过多实在无法全部贴出来。
[size=13.63636302948px]
- source("helpers.R")
- source("loadfunction.R")
- source("main2.R")
- source("main.R")
- source("plotperiod.R")
- Sys.setlocale(locale="English")
- ##################################################
- #Sys.setlocale(locale='Chinese');
- # server.R
- shinyServer(function(input, output) {
-
- dataInput0 <- reactive({
-
- Analysisfun(input$symb,input$dates[1],input$dates[2],comb1)
-
- })
-
-
- dataInput <- reactive({
-
- param1 = as.numeric(input$n_breaks1)
- param2 = as.numeric(input$n_breaks2)
-
- Analysisf(input$symb,input$dates[1],input$dates[2],param1,param2)
-
- })
-
- dataInput2 <- reactive({
-
- param1 = as.numeric(input$n_breaks1)
- param2 = as.numeric(input$n_breaks2)
-
- profitplot(input$symb,input$dates[1],input$dates[2],param1,param2)
-
- })
复制代码- if (!require(quantmod)) {
- stop("This app requires the quantmod package. To install it, run 'install.packages(\"quantmod\")'.\n")
- }
- # Download data for a stock, if needed
- getkc <- function(symbol,startdate,enddate) {
- if (!exists(symbol))
- getSymbols(symbol, src = "yahoo",
- from = startdate,
- to = enddate,
- auto.assign = FALSE)
- }
- Analysisf <- function(symbol,startdate,enddate,param1,param2){
- data <- getkc(symbol,startdate,enddate)
- 。。。。。。。。。。
复制代码
|
|