How to show the hierarchical structure of axis labels using ggplot2?

I would like to create such a plot using ggplot2: Barplot with hierarchical labels on the x axis

(I made a small mistake here, which did not cause all the shortcuts to be displayed. Obviously, I want all the shortcuts to be displayed :)) However, my Google search query did not find anything. The closest I got was with barNest from plotrix, however I do not like the quality of the graphs that are produced. Ggplot2 look much better.

, - : scale_x_discrete ( "Axis Title", = Level1 + Level2 + Level3) Level1, Level2 Level3 , qplot. , , . , scale_x_hierarchical . :

data <- data.frame(
  Subject = c(rep(1, 48), rep(2, 48), rep(3, 48), rep(4, 48)), 
  month = rep(c(rep(1, 12), rep(4, 12), rep(7, 12), rep(10, 12)), 4), 
  day = rep(c(rep(1, 4), rep(11, 4), rep(21, 4)), 16), 
  hour = rep(c(0, 6, 12, 18), 48), 
  data = rnorm(192))

, , , Spotfire.

+5
1

, LearnR post , :

enter image description here

+1

All Articles