ropensci / RNeXML

Implementing semantically rich NeXML I/O in R
https://docs.ropensci.org/RNeXML
Other
13 stars 9 forks source link

Fixes type coercion for morphological characters with polymorphic states #188

Closed hlapp closed 5 years ago

hlapp commented 5 years ago

The algorithm implemented here keeps the previous mechanism for column type coercion, however it is now only applied for characters that don't have a polymorpic or uncertain state.

Accomplishing this without depending on correctly second-guessing the symbol requires knowing for each state whether it is polymorphic, uncertain, or "standard". To not have do this work again if the user wants to have this knowledge as well, we return this on demand in the form of a second matrix whose columns are factors with levels standard, polymorphic, and uncertain. The matrix will have NA where the state is NA.

Fixes #186. Closes #175.

cboettig commented 5 years ago

👏