This is the most basic treemap you can do. The input dataset is simple: we just have 3 groups, and each has a value which we map to an area.
It allows to learn the syntax of the treemap library: you need to provide at least a dataset, the column that describes groups, and the column that gives the size of each group.
See graph # to learn how to add subgroups, and graph # to customize the appearance of the chart.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
# library library(treemap) # Create data group=c("group-1","group-2","group-3") value=c(13,5,22) data=data.frame(group,value) # treemap treemap(data, index="group", vSize="value", type="index" ) |
Not what you are looking for ? Make a new search ![mediatagger]
Leave a Reply