jrowen / rhandsontable

A htmlwidgets implementation of Handsontable.js
http://jrowen.github.io/rhandsontable/
Other
380 stars 147 forks source link

rhandsontable throws error when either rows or columns has length zero #409

Open pepijn-devries opened 2 years ago

pepijn-devries commented 2 years ago

Thanks for bringing handsontable to R!

When feeding a matrix where either rows or columns has length zero to rhandsontable, an error is thrown:

rhandsontable(matrix(numeric(), nrow = 10, ncol = 0))

Can this be fixed? Or when this is expected behaviour, please add so to the documentation.

pepijn-devries commented 2 years ago

As a work-around, I've found the following solution:

rhandsontable(as.data.frame(matrix(numeric(), nrow = 10, ncol = 0)))

Not sure why converting the matrix to a data.frame fixes the issue.