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?
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.
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).
Visualizing hierarchical data using Treemaps is a great way to show items relations to the whole and to each other in a single system.
Take a look at Rgraphviz
, which can allow you to visualize graphs (including trees), using different schemes for your nodes.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With