I try to replicate this circle packing example in R: Visualizing hierarchical data with circle packing in ggplot2? on my own data, but I bumped into a problem that I could not comprehend.
The data is:
Religion <- c("Christianity 1", "Christianity 2", "Buddhism 1", "Buddhism 2", "Islam")
Number <- c(1, 1, 2, 3, 2)
Group <- c("Christian", "Christian", "Buddhism", "Buddhism", "Islammm")
df <- data.frame(Religion, Number, Group)
I want to ultimately draw a circle packing demonstrating the number of people following each religion. The replication derived from the link at the beginning is:
indexList <- c("Group", "Religion")
treedat <- treemap(df, index= indexList, vSize="Number",
type="value", fun.aggregate="sum", palette="RdYlBu")
The error is :
Error in do.call("format", args.legend) : second argument must be a list
Could somebody explain to me what I did wrong?