Arc Diagrams in R: Les Miserables

Content moved to

http://gastonsanchez.com/blog/got-plot/how-to/2013/02/02/Arc-Diagrams-in-R-Les-Miserables.html


About these ads

15 thoughts on “Arc Diagrams in R: Les Miserables

  1. Have you heard of Voyant Tools? They have some really awesome, free to use online text tools that generate really interesting diagrams like these. I use these tools a lot in my text analysis, and I use this tool to style my network diagrams if they need a more polished look.

    Thanks for the awesome post,

    Greg

  2. I’m interested in such visualization. I’m a beginner and I have one basic question, how to prepare the input file “lesmiserables.txt”? Do I need to do some work to prepare the input data?

    Thanks.
    Linda

  3. Hello,

    this looks really interesting! But, as a beginner, I would like to know how to prepare own data and convert it into a GML file or format. I found something on stackoverflow (http://stackoverflow.com/questions/12751497/how-to-convert-csv-file-containing-network-data-into-gml), but here my question would be: which “network-elements” should be in the columns of that csv-file? Or, for instance, taking your Star Wars example: How does the arcdiagramme-package now, whether “Luke” is a node or a tree-branch / arc?

    Do you know what I mean?

    Keep up the great work!
    Best wishes
    Daniel

  4. Hi Gaston,
    thanks, I really like you visualisation and did a number of tests with it when I faced the problem that the weight of a tie between two nodes is according to my impression not visualised correctly (low wight but thick line) even though the edgelist and the weight correspond well. Did you encounter this problem, too?

    Thanks again,
    Tobias

  5. Hi Gaston,
    this package is really interesting but I have a problem.
    Suppose you have this
    edgelist >
    [,1] [,2]
    [1,] 1 4
    [2,] 2 4
    [3,] 3 5
    [4,] 3 6

    and these
    vlabels>
    [1] “a” “b” “c” “d” “e” “f”

    If I run
    arcplot(edgelist, labels=vlabels)

    why do I obtain these edges: a – b, b – c, d – e, d – f
    instead of a – d, b – d, c – e, c – f?

    Where is my mistake?
    Thank you a lot,
    Dani

    • Hi Daniel,
      Here is the solution:

      edgelist = rbind(
      c(1, 4),
      c(2, 4),
      c(3, 5),
      c(3, 6))

      vlabels = c(“a”, “b”, “c”, “d”, “e”, “f”)

      # get x-axis coordinates of nodes
      node_coords = xynodes(edgelist)

      # nodes are plotted in this order
      aux_index = as.numeric(names(node_coords))

      # specify labels accordingly
      arcplot(edgelist, labels=vlabels[aux_index])

      I know it’s kind of weird and unintuitive (I’ll need to make some changes).

      • Thank you!
        Yes, it’s not too much intuitive and I think that the best solution is to create the edge matrix with the names of the nodes
        edgelist = rbind(
        + c(“a”, “d”),
        + c(“b”, “d”),
        + c(“c”, “e”),
        + c(“c”, “f”))

        and then simply

        arcplot(edgelist, labels=NULL, sorted=TRUE)
        ..with sorted=TRUE if you want to order the nodes.
        Bye,
        Dani

  6. I have R v2.13.2, and 2.15.3, and arcdisplay is not available for either version.
    I’ve tried to use 2.11.0 also, and it said arcdisplay could not be found…??????

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s