【问题标题】:R shiny seq instruction error length.outR闪亮的seq指令错误长度.out
【发布时间】: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() 不像你想象的那样工作。
  • 感谢您的帮助,改变您建议的工作方式。我想我必须再次检查如何实现侧栏以使应用程序运行。

标签: r shiny seq


【解决方案1】:

图书馆(闪亮) shinyUI(fluidPage(titlePanel(“Aplicacion”),sidebarLayout(sidebarPanel(sliderInput(“bins”,“bins”, 最小值 = 1,最大值 = 60,值 = 30)), mainPanel(plotOutput("distPlot")))))

【讨论】:

    猜你喜欢
    • 2016-12-29
    • 1970-01-01
    • 2019-05-20
    • 2021-01-09
    • 2015-12-02
    • 1970-01-01
    • 1970-01-01
    • 2013-05-16
    相关资源
    最近更新 更多