I would like some help to code a nested figure using gglot2. The figure is about participants' payoff over periods. There are 60 periods which were partitioned into 12 independent trials. The main reason is that in each trial the maximum payoff one can reach stays the same. An example I find from previous study is attached.
Different from the example, there are 6 interaction conditions in my study: 2 (transparency vs no transparency) x3(no flexibility nor repair, flexibility and repair), so there should be 6 geom_lines in each trial from trial 1 to trial 12. The table head looks like this:
  trial period transparency    flexibility    repair    payoff  
  <int>  <int> <chr>           <chr>          <chr>      <dbl>    
1     1      1 no transparency no flexibility no repair   21.2      
2     1      1 no transparency flexbility     no repair   23.2      
3     1      1 no transparency flexbility     repair      19.3     
4     1      1 transparency    no flexibility no repair   15       
5     1      1 transparency    flexbility     no repair   20.3      
6     1      1 transparency    flexbility     repair      18.8    
the x_aes should be the 12 trials, then within each trial, there is a second layer (5 periods)
the y_aes should be the payoff per period.

 
     
    
