Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
有效错误(ui):对象';用户界面';在TagAssert中找不到错误_R_Shiny_Plotly Dash_Shinydashboard_Shinyapps - Fatal编程技术网

有效错误(ui):对象';用户界面';在TagAssert中找不到错误

有效错误(ui):对象';用户界面';在TagAssert中找不到错误,r,shiny,plotly-dash,shinydashboard,shinyapps,R,Shiny,Plotly Dash,Shinydashboard,Shinyapps,我正在构建一个闪亮的应用程序,当我点击run应用程序时,会出现如下错误: tagAssert(body,type=“div”,class=“content wrapper”)中出现错误: 应为类为'shinny.tag'的对象。 当我单击Ctrl+Enter时。这就是错误所在 有效错误(ui):未找到对象“ui” 这是代码。你能帮忙解决这个问题吗 rm(list=ls()) ## app.R ## library(shiny) library(shinydashboard) library(sh

我正在构建一个闪亮的应用程序,当我点击run应用程序时,会出现如下错误:

tagAssert(body,type=“div”,class=“content wrapper”)中出现错误: 应为类为'shinny.tag'的对象。

当我单击Ctrl+Enter时。这就是错误所在 有效错误(ui):未找到对象“ui”

这是代码。你能帮忙解决这个问题吗

rm(list=ls())
## app.R ##
library(shiny)
library(shinydashboard)
library(shinydashboardPlus)
library(ggplot2)
library(plotly)
library(caTools)
library(caret)
library(Hmisc)
library(data.table)
library(DT)
library(reshape2)
#Estes E9-4
setwd("E:/akshaya/courses/STAR Space/Internship/Team work/Dashboard")
df1 = read.csv("Motor Test Data.csv",stringsAsFactors = F)
View(df1)
# RShiny dashboard
header = dashboardHeader(title = "Solid Motor Test Results")

sidebar = dashboardSidebar(sidebarMenu(id = "tabs",
                                       menuItem("Dashboard", tabName = "Summary", icon = icon("dashboard")),                               
                                       menuItem("Daywise", tabName = "Daywise", icon = icon("chart-line")),
                                       #to get input for a particular tab use conditional panel
                                       conditionalPanel(
                                         "input.tabs == 'Daywise'",
                                         #country selection
                                         selectInput(inputId = "Date", label = "Select Date :", choices = unique(df1$Date_o_fTest),multiple = T)
                                         
                                       ),
                                       
                                       menuItem("Simmulation Summary", tabName = "Model", icon = icon("chart-bar")),
                                       menuItem("Visit-us", icon = icon("send",lib='glyphicon'),href = "https://www.starlabsurat.com/")
)
)

body = dashboardBody(
  tabItems(
    # second tab content
    tabItem(tabName = "Daywise",
            h2("Test Day for the Day"),
            fluidRow(valueBoxOutput("value1",width=3),
                     valueBoxOutput("value2",width=3),
                     valueBoxOutput("value3",width=3)),
    ),
    # third tab content
    tabItem(tabName = "Model",
            h2("Simulation Summary"),
            fluidRow(
              box(title = "Thrust Curve", width = 8,solidHeader = TRUE, collapsible = TRUE,
                  plotlyOutput("plot1",height=250)),
            ),
            
            fluidRow(
              box(title = "Temperature Curve", width = 4,solidHeader = TRUE, collapsible = TRUE,
                  plotlyOutput("plot2",height=250)),
              box(title = "Pressure curve", width = 4,solidHeader = TRUE, collapsible = TRUE,
                  plotlyOutput("plot3",height=250)),
              
            )
    ),
  ))
  
    ui = dashboardPage(header, sidebar, body)
    
    server = function(input, output,session) {
      #for Simulation Summary
      
      output$plot1 = renderPlotly({
        
        ggplotly(ggplot(df1, aes(x=Test_Time_sec, y=Load_Cell_N))+
                   geom_line(size = 1.2,color="red")
                   )
        
      })
      
      output$plot2 = renderPlotly({
        
        ggplotly(ggplot(df1, aes(x=Test_Time_sec, y=Baro_Temp_C))+
                   geom_line(size = 1.2,color="blue")
                   )
        
      })
      
      output$plot3 = renderPlotly({
        
        ggplotly(ggplot(df1, aes(x=Test_Time_sec, y=Baro_Pressure_hpa))+
                   geom_line(size = 1.2,color="green")
                   )
        
      })
      #for Day wise tab 
      
      
      dfsub <- reactive({
        filter(df1,Date_of_Test %in% input$Date)
    })
      # for dashboard view
      Loadvalue <- dfsub[5]
      Tempvalue <- dfsub[6]
      Pressurevalue <- dfsub[7]
      
      output$value1 <- renderValueBox({valueBox(formatC(Loadvalue, format = "f"),'Thrust (in N)',color = "aqua")})
      
      output$value2 <- renderValueBox({valueBox(formatC(Tempvalue, format = "f"),'Thrust (in N)',color = "aqua")})
      output$value3 <- renderValueBox({valueBox(formatC(Pressurevalue, format = "f"),'Thrust (in N)',color = "aqua")})
    }
    
    shinyApp(ui = ui, server = server)
    
rm(list=ls())
##应用程序R##
图书馆(闪亮)
图书馆(shinydashboard)
图书馆(shinydashboardPlus)
图书馆(GG2)
图书馆(绘本)
图书馆(caTools)
图书馆(插入符号)
图书馆(Hmisc)
库(数据表)
图书馆(DT)
图书馆(E2)
#埃斯特斯E9-4
setwd(“E:/akshaya/课程/星空/实习/团队合作/仪表板”)
df1=read.csv(“电机测试数据.csv”,stringsAsFactors=F)
视图(df1)
#轻薄的仪表板
页眉=仪表板页眉(title=“固体发动机测试结果”)
侧边栏=仪表板侧边栏(侧边栏菜单(id=“tabs”,
菜单项(“仪表板”,tabName=“摘要”,icon=图标(“仪表板”),
menuItem(“Daywise”,tabName=“Daywise”,icon=icon(“图表线”),
#要获取特定选项卡的输入,请使用条件面板
条件板(
“input.tabs=='Daywise',
#国家选择
选择输入(inputId=“Date”,label=“Select Date:”,选项=unique(df1$Date\u o\u fTest),多个=T)
),
菜单项(“模拟摘要”,tabName=“模型”,icon=图标(“图表栏”),
菜单项(“访问我们”,图标=图标(“发送”,lib='glyphicon'),href=”https://www.starlabsurat.com/")
)
)
车身=仪表板车身(
tabItems(
#第二个选项卡内容
tabItem(tabName=“Daywise”,
h2(“当天的测试日”),
fluidRow(valueBoxOutput(“值1”,宽度=3),
valueBoxOutput(“value2”,宽度=3),
valueBoxOutput(“value3”,宽度=3)),
),
#第三选项卡内容
tabItem(tabName=“Model”,
h2(“模拟总结”),
fluidRow(
框(title=“推力曲线”,宽度=8,solidHeader=TRUE,可折叠=TRUE,
plotlyOutput(“plot1”,高度=250)),
),
fluidRow(
框(title=“温度曲线”,宽度=4,solidHeader=TRUE,可折叠=TRUE,
plotlyOutput(“plot2”,高度=250)),
框(title=“压力曲线”,宽度=4,solidHeader=TRUE,可折叠=TRUE,
plotlyOutput(“plot3”,高度=250)),
)
),
))
ui=仪表板页面(标题、侧边栏、正文)
服务器=功能(输入、输出、会话){
#用于模拟总结
输出$plot1=renderPlotly({
ggplotly(ggplot(df1,aes(x=测试时间秒,y=称重传感器)+
几何尺寸线(尺寸=1.2,颜色=“红色”)
)
})
输出$plot2=renderPlotly({
ggplotly(ggplot(df1,aes(x=测试时间秒,y=气压温度C))+
几何尺寸线(尺寸=1.2,颜色=“蓝色”)
)
})
输出$plot3=renderPlotly({
ggplotly(ggplot(df1,aes(x=测试时间秒,y=气压hpa))+
几何尺寸线(尺寸=1.2,颜色=“绿色”)
)
})
#按天计费

dfsub在您的
选项卡items
中有一个尾随逗号,您必须将其删除

    # third tab content
    tabItem(tabName = "Model",
            h2("Simulation Summary"),
            fluidRow(
              box(title = "Thrust Curve", width = 8,solidHeader = TRUE, collapsible = TRUE,
                  plotlyOutput("plot1",height=250)),
            ),
            
            fluidRow(
              box(title = "Temperature Curve", width = 4,solidHeader = TRUE, collapsible = TRUE,
                  plotlyOutput("plot2",height=250)),
              box(title = "Pressure curve", width = 4,solidHeader = TRUE, collapsible = TRUE,
                  plotlyOutput("plot3",height=250)),
              
            )
    ), #### <-- REMOVE THIS COMMA
  ))
#第三个选项卡内容
tabItem(tabName=“Model”,
h2(“模拟总结”),
fluidRow(
框(title=“推力曲线”,宽度=8,solidHeader=TRUE,可折叠=TRUE,
plotlyOutput(“plot1”,高度=250)),
),
fluidRow(
框(title=“温度曲线”,宽度=4,solidHeader=TRUE,可折叠=TRUE,
plotlyOutput(“plot2”,高度=250)),
框(title=“压力曲线”,宽度=4,solidHeader=TRUE,可折叠=TRUE,
plotlyOutput(“plot3”,高度=250)),
)

),#########非常感谢,我删除了逗号,但得到了相同的错误。请您帮助。@Padmasree它对我有效。如果您得到“ui未找到”,那是因为您的
ui
定义中有一些错误。复制代码并粘贴到R控制台中,您将得到错误消息。