【发布时间】:2015-05-06 04:07:51
【问题描述】:
我正在尝试制作一个介于 2005 年和 2040 年之间的滑块输入。看起来很简单,对吧?通常它工作正常,但每隔一段时间我会将滑块向左拉得太远,它会给我 NaN,这往往会导致崩溃。我试图设置我的其余代码,使其没有问题,但它仍然困扰着我。我已经在互联网上搜索了解释,但到目前为止还没有。这是我的 ui.R:
library(shiny)
shinyUI(fluidPage(
titlePanel("Test"),
sidebarLayout(
sidebarPanel(
selectInput("over", "Indicator", c("Indicator 1", "Indicator 2"), selected="Trade"),
selectInput("type", "Type", c("Discrete", "Continuous")),
# Nothing particularly unusual here...
sliderInput("year", "Year", min=2005, max=2040, value=2005, animate=animationOptions(interval=1500), sep=""),
checkboxInput("table", "Show Table")
, width=3),
mainPanel(
uiOutput("plot"),
uiOutput("showtable")
, width=9)
)
))
【问题讨论】:
-
自学问题——为什么需要
animate=animationOptions(interval=1500)? -
当数据加载为默认值时(间隔 = 1000),我遇到了问题。不过,从那以后我已经做了一些优化,我可能可以把它拿出来。但是,问题在我添加之前就开始了。
标签: r slider shiny rangeslider