【发布时间】:2018-01-12 21:37:09
【问题描述】:
我是初学者,我按照 youtube 教程为我的第一个闪亮的应用程序编写了一个简短的代码。
我收到以下错误:参数 'length.out' 的长度必须为 1
有两个R脚本第一个是:
library(shiny)
shinyServer(function(input,output){
output$distPlot<-renderPlot({
x<-faithful[,2]
bins<-seq(min(x),max(x),length.out=input$bins)
hist(x,breaks=bins,col="darkgray",border="white")
})
})
第二个文件:
library(shiny)
shinyUI(fluidPage(titlePanel("Shiny
Application"),sidebarLayout(sidebarPanel("bins","number of
bins",min=1,max=60,value=30),
mainPanel(plotOutput("distPlot")))))
我检查了几次instruction并搜索了帮助信息,但我找不到问题所在,一些建议或帮助?
谢谢
【问题讨论】:
-
您没有为
bins创建输入元素。你可能想要一个numericInput()。sidebarPanel()不像你想象的那样工作。 -
感谢您的帮助,改变您建议的工作方式。我想我必须再次检查如何实现侧栏以使应用程序运行。