Closed wdahdul closed 2 years ago
@wdahdul I think lundberg_nexml
in your code is a list. Try using lapply
to apply get_char_matrix
.
Something like:
lundberg_matrix <- lapply(lundberg_nexml, function(nex) get_char_matrix(nex))
See the updated example for version 0.3.0: http://rphenoscape.phenoscape.org/articles/rphenoscape.html#character-matrices-for-studies.
Thanks John!
You could also (and it be more straightforward to) just say
lundberg_matrix <- get_char_matrix(lundberg_nexml[[1]])
When using get_char_matrix() to extract the matrix as a data.frame from a NeXML object, I'm getting an error and can't extract the matrix:
The above is from running the short course tutorial https://phenoscape.org/scate-shortcourse/articles/01_rphenoscape.html