Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I visualize hierarchical data?

I have some data like the following:

A A1 12
A A2 23
A A3 AA1 1
A A3 AA2 2
B B1 2
B B2 1

Is there a way to visualize this information in ggplot? I am looking for something like this:

   |--A1---12
   |--A2---23
A--|--A3--AA1--1
      |---AA2--2

B--|--B1---2
   |--B2---1

Any suggestions?

like image 574
Legend Avatar asked Sep 16 '11 06:09

Legend


People also ask

Which chart is mainly used for displaying hierarchical data?

Treemaps are a data-visualization technique for large, hierarchical data sets. They capture two types of information in the data: (1) the value of individual data points; (2) the structure of the hierarchy. Definition: Treemaps are visualizations for hierarchical data.

Is the visual representation of hierarchical data?

Hierarchical data is shown in tree graphs; so called because of their similarity to a tree's structure (though a tree which has been turned upside down so that the root is at the top and the branches form below it).

How do you represent different levels of hierarchy of data in one single visualization?

Visualizing hierarchical data using Treemaps is a great way to show items relations to the whole and to each other in a single system.


2 Answers

Take a look at Rgraphviz, which can allow you to visualize graphs (including trees), using different schemes for your nodes.

like image 66
Iterator Avatar answered Oct 12 '22 08:10

Iterator


Are you set on using ggplot? Personally, I would not process this kind of data in R since it's not really of statistical nature. I would rather write a python script to build a tree/forest, and view it using one of the many excellent graph visualization tools out there, e.g. Gephi.

like image 22
mitchus Avatar answered Oct 12 '22 08:10

mitchus