我正在尝试为R中的滑块输入打印所选范围,但它显示为null。
这是我的UI.r
shinyUI(pageWithSidebar(
headerPanel("Test"),
sidebarPanel(
sliderInput("StikeRange", "Strike Range:", min = 1, max = 10, value = c(4,6) )
),
mainPanel(
verbatimTextOutput("test")
)
))
这是我的服务器.R
shinyServer(function(input, output) {
output$test<-renderPrint({
print( c(input$StrikeRange[1],input$StrikeRange[2]))
})
})
目前正在打印NULL。
知道如何访问范围吗?
谢谢!
答案 0 :(得分:0)
shinyUI(pageWithSidebar(
headerPanel("Test"),
sidebarPanel(
sliderInput("StrikeRange", "Strike Range:", min = 1, max = 10, value = c(4,6) )
),
不确定这是否解决了您的问题,但您在ui.R中输入了错字: 你在没有 r 的情况下写了“StikeRange”。