I am lost in how to create the hierarchy with R's SunburstR package
sunburstR::sunburst(data=as.data.frame(iris, legendOrder=list("Species", "Sepal.Length")))
where the pedagocical example tries to create a hierarchy with the well-known iris dataset. The inner most layer would have 3 groups: setosa, versicolor and virginica -- and outmost layers showing the proportion of certain numeric things such as sepal length.
You have to specify the path with each node separated by dash such that
iris
%>% mutate(path = paste(Species, Sepal.Length, Petal.Width, sep='-'))
%>% select(path, Petal.Length) %>% sunburst()
where Petal.Length
here is the value you want to visualise on the outermost layer with respect to the path starting from the innermost layer to the outermost layer
and in visually more pleasing order such that
iris
%>% arrange(desc(Petal.Length), desc(Sepal.Length), desc(Petal.Width))
%>% mutate(path = paste(Species, Sepal.Length, Petal.Width, sep='-'))
%>% select(path, Petal.Length)
%>% sunburst(breadcrumb = list(w=200))