Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hot_to_r fails for rhandsontables based on matrix objects #359

Open
ismirsehregal opened this issue Jul 7, 2020 · 0 comments
Open

hot_to_r fails for rhandsontables based on matrix objects #359

ismirsehregal opened this issue Jul 7, 2020 · 0 comments

Comments

@ismirsehregal
Copy link

ismirsehregal commented Jul 7, 2020

rhandsontable objects created using a matrix object cannot be converted back to R via hot_to_r. As shown in the below example the conversion seems to be limited to data.frames:

library(shiny)
library(rhandsontable)

ui <- fluidPage(
  rHandsontableOutput("myTable"),
  tableOutput("my2ndTable")
)

server <- function(input, output, session) {
  
  # output$myTable <- renderRHandsontable({rhandsontable(as.data.frame(matrix(c(1:25) * i, ncol = 5, nrow = 5)))}) # works
  output$myTable <- renderRHandsontable({rhandsontable(matrix(c(1:25) * i, ncol = 5, nrow = 5))}) # doesn't work
  
  output$my2ndTable <- renderTable({
    hot_to_r(req(input$myTable))
  })
  
}

shinyApp(ui, server)
Warning: Error in genColHeaders: Change no recognized:afterChange
  105: stop
  104: genColHeaders
  103: <Anonymous>
  101: hot_to_r
  100: renderTable [~/.active-rstudio-document#14]
   99: func
   86: origRenderFunc
   85: output$my2ndTable
    5: runApp
    3: print.shiny.appobj
    1: source

I saw this problem here first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant