我正在尝试构建一个调度程序,用户可以在其中为每个时间段输入表中的名称。但是,我在运行 rhandsontable 时遇到了困难。我收到以下错误消息:
Listening on http://127.0.0.1:3547
Warning: Error in .subset2(x, "impl")$defineOutput: Unexpected rhandsontable
output for hotUnexpected htmlwidget output for hot
Stack trace (innermost first):
40: .subset2(x, "impl")$defineOutput
39: $<-.shinyoutput
38: $<- [C:\Users\USER\Documents\RProject\scheduler/app.R#31]
37: server [C:\Users\USER\Documents\RProject\scheduler/app.R#31]
1: runApp
Error in .subset2(x, "impl")$defineOutput(name, value, label) :
Unexpected rhandsontable output for hotUnexpected htmlwidget output for hot
这是我的 .app 代码:
library(shiny)
library(rhandsontable)
ui <- fluidPage(
sidebarLayout(
sidebarPanel(
),
mainPanel(
rHandsontableOutput("hot")
)
)
)
server <- function(input, output, session) {
df <- data.frame(time=c("09-12","12-15","15-18","18-21","21-24","24-03","03-06","06-09"),
monday=c("","","","","","","",""),
tuesday=c("","","","","","","",""),
wednesday=c("","","","","","","",""),
thursday=c("","","","","","","",""),
friday=c("","","","","","","",""),
saturday=c("","","","","","","",""),
sunday=c("","","","","","","",""))
output$hot<- rhandsontable(df, rowHeaders = NULL)
}
# Run the application
shinyApp(ui = ui, server = server)