问题描述
我正在构建一个闪亮的应用程序,但收到此错误: dots_list(...) 中的错误:缺少参数“标签”,没有默认值。我检查了我的用户界面,看看我是否遗漏了任何标签,但我没有找到任何标签并用谷歌搜索了很多次但没有找到任何解决方案?任何人都可以帮忙吗?这是我的用户界面和服务器---
- 界面
library(shinydashboard)
library(shiny)
library(htmltools)
ui <- fluidPage(
titlePanel("Crop Area Allocation App"),sidebarLayout(
sidebarPanel(
numericInput("landsize","Please select Land Size in Bigha: ",min=1,max=1000,value=10,step=1),numericInput("invest","Please Write Investment Amount in Rs.: ",min=25000,max=5000000,value = 100000,step=25000),textInput("crop1","Please Write Name of First Crop: "),numericInput("rev1","Expected Revenue per Bigha for Crop1 in Rs.: ",min=1000,max=500000,value=20000,step=2000),numericInput("cos1","Expected Cost per Bigha for Crop1 in Rs.: ",value=15000,step=1000),textInput("crop2","Please Write Name of Second Crop: "),numericInput("rev2","Expected Revenue per Bigha for Crop2 in Rs.: ",numericInput("cos2","Expected Cost per Bigha for Crop2 in Rs.: ",br(),actionButton("ClickMe","Click Me")
),mainPanel(
h4(strong("Land Size Mentioned by You in Bigha: ")),textoutput("lsize"),h4(strong("Investment Amount Mentioned by You in Rs.: ")),textoutput("investment"),h4(strong("You Selected following crops: ")),textoutput("cn1"),textInput("cn2"),h4(strong("Revenue of Crop1 Per Bigha in Rs.: ")),textoutput("revenue1"),h4(strong("Cost of Crop1 Per Bigha in Rs.: ")),textoutput("cost1"),h4(strong("Profit for Crop1 Per Bigha in Rs.: ")),textoutput("Prof1"),h4(strong("Revenue of Crop2 Per Bigha in Rs.: ")),textoutput("revenue2"),h4(strong("Cost of Crop2 Per Bigha in Rs.: ")),textoutput("cost2"),h4(strong("Profit for Crop2 Per Bigha in Rs.: ")),textoutput("Prof2"),br()
)
))
- 服务器
server <- function(input,output) {
ls=eventReactive(input$ClickMe,{
input$landsize
})
output$lsize=renderText({paste(ls()," Bigha")})
inv=eventReactive(input$ClickMe,{
input$invest
})
output$investment=renderText({paste("Rs. ",inv())})
cr1=eventReactive(input$ClickMe,{
input$crop1
})
output$cn1=renderText({cr1()})
rv1=eventReactive(input$ClickMe,{
input$rev1
})
output$revenue1=renderText({paste("Rs. ",rv1())})
cs1=eventReactive(input$ClickMe,{
input$cos1
})
output$cost1=renderText({paste("Rs. ",cs1())})
output$Prof1=renderText({paste("Rs. ",rv1()-cs1()," per Bigha")})
cr2=eventReactive(input$ClickMe,{
input$crop2
})
output$cn2=renderText({cr2()})
rv2=eventReactive(input$ClickMe,{
input$rev2
})
output$revenue2=renderText({paste("Rs. ",rv2())})
cs2=eventReactive(input$ClickMe,{
input$cos2
})
output$cost2=renderText({paste("Rs. ",cs2())})
output$Prof2=renderText({paste("Rs. ",rv2()-cs2()," per Bigha")})
}
运行应用程序
shinyApp(ui = ui,server = server)
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)