jrowen / rhandsontable

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

hot_to_r breaks when table has glue fields #394

Open elfatherbrown opened 3 years ago

elfatherbrown commented 3 years ago

Hi. If I knew how to make a reprex for shiny reactives, I would. I got his error with my data:

Warning: Error in as: no method or default for coercing “character” to “NA”
  107: stop
  106: as
  103: colClasses
  102: <Anonymous>
  100: hot_to_r

The problem is that if you have a tibble in your code where any field was constructed by glue::glue, those fields have two classes (character AND glue). The code in toR calls colClasses, which cannot handle fields with two classes (character and glue in this case). I "fixed" it by setting as.character in my data construction for glued fields. Took a while to figure it out and I have no idea how to better handle this in the colClasses, or this would be a PR.

Thanks. Sorry I cant do a better report. I post it if people find themselves with this error: make sure your glued fields are passed through as.character() to fix this.