Skip to content

Adding characters fails for some matrices #239

@hlapp

Description

@hlapp

The following snippet:

nex <- nexml_read(system.file("examples", "ontotrace-result.xml", package = "RNeXML"))
x <- nexml_write(characters = get_characters(nex))

results in the following error (with traceback):

 Error in map[2, ] : incorrect number of dimensions 

10.map_states_to_symbols(states[[char@states]]) at deprecated.R#127
9. FUN(X[[i]], ...) 
8. lapply(format@char, function(char) {
    states <- format@states
    ids <- sapply(states, function(states) states@id)
    names(states) <- ids ... at deprecated.R#121
7. map_state_to_symbol(characters@format) at internal_get_node_maps.R#34
6. FUN(X[[i]], ...) 
5. lapply(nexml@characters, function(characters) {
    if (!isEmpty(characters@format@states)) 
        map_state_to_symbol(characters@format)
    else NULL ... at internal_get_node_maps.R#33
4. get_state_maps(nexml) at add_characters.R#195
3. add_rows(nexml, x, i, j) at add_characters.R#49
2. add_characters(characters, nexml = nexml) at nexml_write.R#63
1. nexml_write(characters = get_characters(nex)) 

This was initially reported in passing in #235, and remains unresolved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions