如何在闪亮的 App 上使用 R 动手 table

How to use R hands on table with shiny App

我正在尝试使用 rhandsontable 创建一个闪亮的应用程序。我正在使用下面的代码:

library(shiny)
library(rhandsontable)
library(ggplot2)


  ui = fluidPage(
  rHandsontableOutput ('table'))


  server = function(input, output, session) {
    output$table < renderRHandsontable(mpg)}

  shinyApp(ui, server)

当我 运行 代码时出现错误 "rendering objects from shinyoutput not allowed" 知道为什么会这样吗?

应该这样做:

library(shiny)
library(rhandsontable)
library(ggplot2)

ui <- fluidPage(
  mainPanel(
    rHandsontableOutput('table')
  )
)

server = function(input, output, session) {

  output$table <- renderRHandsontable({
    rhandsontable(head(mpg))
  })

}

shinyApp(ui, server)