rhandsontable icon indicating copy to clipboard operation
rhandsontable copied to clipboard

rhandsontable throws error when either rows or columns has length zero

Open pepijn-devries opened this issue 2 years ago • 1 comments

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 avatar Jun 12 '22 21:06 pepijn-devries

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.

pepijn-devries avatar Jun 12 '22 21:06 pepijn-devries