subscript out of bounds error

Issue #8 duplicate
Tim Smith created an issue

When I run the simple example code (see below the actual code I ran) I get the following error:

"Error in nodesi : subscript out of bounds"

This is the code I ran...

library(rgexf)

people <- matrix(c(1:4, 'juan', 'pedro', 'matthew', 'carlos'),ncol=2)

relations <- matrix(c(1,4,1,2,1,3,2,3,3,4,4,2), ncol=2, byrow=T)

write.gexf(people, relations)

Comments (6)

  1. George Vega Yon repo owner

    Dear Tim,

    This issue was declared and solved in the Issue #7 (please see). The thing is that you should use data.frames instead of matrix.

    Thanks anyway!

    George

  2. Tim Smith reporter

    Here's some sample code (for others to follow)

    library(rgexf)

    people <- data.frame(node=c(1:4), label=c('juan', 'pedro', 'matthew', 'carlos'))

    people

    relations <- data.frame(source=c(1,1,1,1), target=c(2,3,4,2))

    relations

    write.gexf(people, relations)

  3. Log in to comment