我创建了一个非常基本的交互式RMarkdown闪亮文档。当我在R Studio中运行文档时,效果很好。但是,当我在Shinyapps.io中发布它时,它的运行速度非常慢。该应用程序真的很轻巧,所以我想知道我的代码是否做错了什么。 代码是:
---
title: "Document.Rmd"
author: ""
date: "September 12, 2018"
output: html_document
runtime: shiny_prerendered
---
## Step 1. Create a new system, or choose a pre-existing one
```{r, context="render", echo=FALSE}
selectInput(inputId = "river", label = h3("Choose your system"),
choices = list("St. Croix" = 1, "Create your own system" = 2))
uiOutput("riverout")
conditionalPanel(
condition = "input$river == 2",
textOutput("see")
)
```
```{r, context="server"}
output$riverout<-renderUI({
ans<-reactive({input$test})
output$see<-renderText(ans())
if (input$river==1){
# textOutput("stcroix")
# tmp<-"If you read this, this chunk of code is working"
# renderText(tmp)
# renderPrint(tmp)
# print(tmp)
} else if (input$river==2){
radioButtons("test", "Choose number of dams", c(1,2,3,4,5))
}
})
```
***
Habitat App
BETA Version 1.0.1
可以从以下位置访问该应用:access app here