Как нарисовать сюжет geom_tile - PullRequest
2 голосов
/ 29 апреля 2019

Я хочу создать график, который показывает графики работы на каждый день.Данные, с которыми мне приходится работать, выглядят примерно так:

   dput(head (TiNiSWeek, 3))

structure(list(`04:00` = c(0, 0, 0), `04:15` = c(0, 0, 0), `04:30` = c(0, 
0, 0), `04:45` = c(0, 0, 0), `05:00` = c(0, 0, 0), `05:15` = c(0, 
0, 0), `05:30` = c(0, 0, 0), `05:45` = c(0, 0, 0), `06:00` = c(0, 
0, 0), `06:15` = c(0, 0, 0), `06:30` = c(0, 0, 0), `06:45` = c(0, 
0, 0), `07:00` = c(0, 0, 0), `07:15` = c(0, 0, 0), `07:30` = c(0, 
0, 0), `07:45` = c(0, 0, 0), `08:00` = c(0, 0, 2), `08:15` = c(0, 
0, 2), `08:30` = c(0, 0, 2), `08:45` = c(0, 0, 2), `09:00` = c(0, 
2, 2), `09:15` = c(0, 2, 2), `09:30` = c(0, 2, 2), `09:45` = c(0, 
2, 2), `10:00` = c(0, 2, 2), `10:15` = c(0, 2, 2), `10:30` = c(0, 
2, 2), `10:45` = c(0, 2, 2), `11:00` = c(0, 2, 2), `11:15` = c(0, 
2, 2), `11:30` = c(0, 2, 2), `11:45` = c(0, 2, 2), `12:00` = c(0, 
2, 0), `12:15` = c(0, 2, 2), `12:30` = c(0, 2, 2), `12:45` = c(0, 
2, 2), `13:00` = c(0, 2, 2), `13:15` = c(0, 2, 2), `13:30` = c(0, 
2, 2), `13:45` = c(0, 2, 2), `14:00` = c(0, 2, 2), `14:15` = c(0, 
2, 2), `14:30` = c(0, 2, 2), `14:45` = c(0, 2, 2), `15:00` = c(0, 
2, 2), `15:15` = c(0, 2, 2), `15:30` = c(0, 2, 2), `15:45` = c(0, 
2, 2), `16:00` = c(0, 2, 2), `16:15` = c(0, 2, 2), `16:30` = c(0, 
2, 2), `16:45` = c(0, 2, 2), `17:00` = c(0, 2, 0), `17:15` = c(0, 
2, 0), `17:30` = c(0, 2, 0), `17:45` = c(0, 0, 0), `18:00` = c(0, 
0, 0), `18:15` = c(0, 0, 0), `18:30` = c(0, 0, 0), `18:45` = c(0, 
0, 0), `19:00` = c(0, 0, 0), `19:15` = c(0, 0, 0), `19:30` = c(0, 
0, 0), `19:45` = c(0, 0, 0), `20:00` = c(0, 0, 0), `20:15` = c(0, 
0, 0), `20:30` = c(0, 0, 0), `20:45` = c(0, 0, 0), `21:00` = c(0, 
0, 0), `21:15` = c(0, 0, 0), `21:30` = c(0, 0, 0), `21:45` = c(0, 
0, 0), `22:00` = c(0, 0, 0), `22:15` = c(0, 0, 0), `22:30` = c(0, 
0, 0), `22:45` = c(0, 0, 0), `23:00` = c(0, 0, 0), `23:15` = c(0, 
0, 0), `23:30` = c(0, 0, 0), `23:45` = c(0, 0, 0), `00:00` = c(0, 
0, 0), `00:15` = c(0, 0, 0), `00:30` = c(0, 0, 0), `00:45` = c(0, 
0, 0), `01:00` = c(0, 0, 0), `01:15` = c(0, 0, 0), `01:30` = c(0, 
0, 0), `01:45` = c(0, 0, 0), `02:00` = c(0, 0, 0), `02:15` = c(0, 
0, 0), `02:30` = c(0, 0, 0), `02:45` = c(0, 0, 0), `03:00` = c(0, 
0, 0), `03:15` = c(0, 0, 0), `03:30` = c(0, 0, 0), `03:45` = c(0, 
0, 0), `04:00` = c(0, 0, 0), `04:15` = c(0, 0, 0), `04:30` = c(0, 
0, 0), `04:45` = c(0, 0, 0), `05:00` = c(0, 0, 0), `05:15` = c(0, 
0, 0), `05:30` = c(0, 0, 0), `05:45` = c(0, 0, 0), `06:00` = c(0, 
0, 0), `06:15` = c(0, 0, 0), `06:30` = c(0, 0, 0), `06:45` = c(0, 
0, 0), `07:00` = c(2, 0, 0), `07:15` = c(2, 0, 0), `07:30` = c(2, 
0, 0), `07:45` = c(2, 0, 0), `08:00` = c(2, 0, 2), `08:15` = c(2, 
0, 2), `08:30` = c(2, 0, 2), `08:45` = c(2, 0, 2), `09:00` = c(2, 
2, 2), `09:15` = c(2, 2, 2), `09:30` = c(2, 2, 2), `09:45` = c(2, 
2, 2), `10:00` = c(2, 2, 2), `10:15` = c(2, 2, 2), `10:30` = c(2, 
2, 2), `10:45` = c(2, 2, 2), `11:00` = c(2, 2, 2), `11:15` = c(2, 
2, 2), `11:30` = c(2, 2, 2), `11:45` = c(2, 2, 2), `12:00` = c(2, 
2, 0), `12:15` = c(2, 2, 0), `12:30` = c(2, 2, 2), `12:45` = c(2, 
2, 2), `13:00` = c(2, 2, 2), `13:15` = c(2, 2, 2), `13:30` = c(2, 
2, 2), `13:45` = c(2, 2, 2), `14:00` = c(2, 2, 2), `14:15` = c(2, 
2, 2), `14:30` = c(2, 2, 2), `14:45` = c(2, 2, 2), `15:00` = c(2, 
2, 2), `15:15` = c(2, 2, 2), `15:30` = c(2, 2, 2), `15:45` = c(2, 
2, 2), `16:00` = c(2, 2, 2), `16:15` = c(2, 2, 2), `16:30` = c(2, 
2, 2), `16:45` = c(2, 2, 2), `17:00` = c(2, 2, 2), `17:15` = c(0, 
2, 2), `17:30` = c(0, 2, 0), `17:45` = c(0, 2, 0), `18:00` = c(0, 
0, 0), `18:15` = c(0, 0, 0), `18:30` = c(0, 0, 0), `18:45` = c(0, 
0, 0), `19:00` = c(0, 0, 0), `19:15` = c(0, 0, 0), `19:30` = c(0, 
0, 0), `19:45` = c(0, 0, 0), `20:00` = c(0, 0, 0), `20:15` = c(0, 
0, 0), `20:30` = c(0, 0, 0), `20:45` = c(0, 0, 0), `21:00` = c(0, 
0, 0), `21:15` = c(0, 0, 0), `21:30` = c(0, 0, 0), `21:45` = c(0, 
0, 0), `22:00` = c(0, 0, 0), `22:15` = c(0, 0, 0), `22:30` = c(0, 
0, 0), `22:45` = c(0, 0, 0), `23:00` = c(0, 0, 0), `23:15` = c(0, 
0, 0), `23:30` = c(0, 0, 0), `23:45` = c(0, 0, 0), `00:00` = c(0, 
0, 0), `00:15` = c(0, 0, 0), `00:30` = c(0, 0, 0), `00:45` = c(0, 
0, 0), `01:00` = c(0, 0, 0), `01:15` = c(0, 0, 0), `01:30` = c(0, 
0, 0), `01:45` = c(0, 0, 0), `02:00` = c(0, 0, 0), `02:15` = c(0, 
0, 0), `02:30` = c(0, 0, 0), `02:45` = c(0, 0, 0), `03:00` = c(0, 
0, 0), `03:15` = c(0, 0, 0), `03:30` = c(0, 0, 0), `03:45` = c(0, 
0, 0), `04:00` = c(0, 0, 0), `04:15` = c(0, 0, 0), `04:30` = c(0, 
0, 0), `04:45` = c(0, 0, 0), `05:00` = c(0, 0, 0), `05:15` = c(0, 
0, 0), `05:30` = c(0, 0, 0), `05:45` = c(0, 0, 0), `06:00` = c(0, 
0, 0), `06:15` = c(0, 0, 0), `06:30` = c(0, 0, 0), `06:45` = c(0, 
0, 0), `07:00` = c(0, 0, 0), `07:15` = c(0, 0, 0), `07:30` = c(0, 
0, 0), `07:45` = c(0, 0, 0), `08:00` = c(0, 0, 2), `08:15` = c(0, 
0, 2), `08:30` = c(0, 0, 2), `08:45` = c(0, 0, 2), `09:00` = c(0, 
0, 2), `09:15` = c(0, 0, 2), `09:30` = c(0, 2, 2), `09:45` = c(0, 
2, 2), `10:00` = c(0, 2, 2), `10:15` = c(0, 2, 2), `10:30` = c(0, 
2, 2), `10:45` = c(0, 2, 2), `11:00` = c(0, 2, 2), `11:15` = c(0, 
2, 2), `11:30` = c(0, 2, 2), `11:45` = c(0, 2, 2), `12:00` = c(0, 
2, 2), `12:15` = c(0, 2, 2), `12:30` = c(0, 2, 2), `12:45` = c(0, 
2, 2), `13:00` = c(0, 2, 2), `13:15` = c(0, 2, 0), `13:30` = c(0, 
2, 0), `13:45` = c(0, 2, 2), `14:00` = c(0, 2, 2), `14:15` = c(0, 
2, 2), `14:30` = c(0, 2, 2), `14:45` = c(0, 2, 2), `15:00` = c(0, 
2, 2), `15:15` = c(0, 2, 2), `15:30` = c(0, 2, 2), `15:45` = c(0, 
2, 2), `16:00` = c(0, 2, 2), `16:15` = c(0, 2, 2), `16:30` = c(0, 
2, 2), `16:45` = c(0, 2, 2), `17:00` = c(0, 2, 2), `17:15` = c(0, 
2, 0), `17:30` = c(0, 2, 0), `17:45` = c(0, 2, 0), `18:00` = c(0, 
0, 0), `18:15` = c(0, 0, 0), `18:30` = c(0, 0, 0), `18:45` = c(0, 
0, 0), `19:00` = c(0, 0, 0), `19:15` = c(0, 0, 0), `19:30` = c(0, 
0, 0), `19:45` = c(0, 0, 0), `20:00` = c(0, 0, 0), `20:15` = c(0, 
0, 0), `20:30` = c(0, 0, 0), `20:45` = c(0, 0, 0), `21:00` = c(0, 
0, 0), `21:15` = c(0, 0, 0), `21:30` = c(0, 0, 0), `21:45` = c(0, 
0, 0), `22:00` = c(0, 0, 0), `22:15` = c(0, 0, 0), `22:30` = c(0, 
0, 0), `22:45` = c(0, 0, 0), `23:00` = c(0, 0, 0), `23:15` = c(0, 
0, 0), `23:30` = c(0, 0, 0), `23:45` = c(0, 0, 0), `00:00` = c(0, 
0, 0), `00:15` = c(0, 0, 0), `00:30` = c(0, 0, 0), `00:45` = c(0, 
0, 0), `01:00` = c(0, 0, 0), `01:15` = c(0, 0, 0), `01:30` = c(0, 
0, 0), `01:45` = c(0, 0, 0), `02:00` = c(0, 0, 0), `02:15` = c(0, 
0, 0), `02:30` = c(0, 0, 0), `02:45` = c(0, 0, 0), `03:00` = c(0, 
0, 0), `03:15` = c(0, 0, 0), `03:30` = c(0, 0, 0), `03:45` = c(0, 
0, 0), `04:00` = c(0, 0, 0), `04:15` = c(0, 0, 0), `04:30` = c(0, 
0, 0), `04:45` = c(0, 0, 0), `05:00` = c(0, 0, 0), `05:15` = c(0, 
0, 0), `05:30` = c(0, 0, 0), `05:45` = c(0, 0, 0), `06:00` = c(0, 
0, 0), `06:15` = c(0, 0, 0), `06:30` = c(0, 0, 0), `06:45` = c(0, 
0, 0), `07:00` = c(0, 0, 0), `07:15` = c(0, 0, 0), `07:30` = c(0, 
0, 0), `07:45` = c(0, 0, 0), `08:00` = c(0, 0, 2), `08:15` = c(0, 
0, 2), `08:30` = c(0, 0, 2), `08:45` = c(0, 0, 2), `09:00` = c(0, 
2, 2), `09:15` = c(0, 2, 2), `09:30` = c(0, 2, 2), `09:45` = c(0, 
2, 2), `10:00` = c(0, 2, 2), `10:15` = c(0, 2, 2), `10:30` = c(0, 
2, 2), `10:45` = c(0, 2, 2), `11:00` = c(0, 2, 2), `11:15` = c(0, 
2, 2), `11:30` = c(0, 2, 2), `11:45` = c(0, 2, 2), `12:00` = c(0, 
2, 2), `12:15` = c(0, 2, 2), `12:30` = c(0, 2, 2), `12:45` = c(0, 
2, 2), `13:00` = c(0, 2, 0), `13:15` = c(0, 2, 2), `13:30` = c(0, 
2, 2), `13:45` = c(0, 2, 2), `14:00` = c(0, 2, 2), `14:15` = c(0, 
2, 2), `14:30` = c(0, 2, 2), `14:45` = c(0, 2, 2), `15:00` = c(0, 
2, 2), `15:15` = c(0, 2, 2), `15:30` = c(0, 2, 2), `15:45` = c(0, 
2, 2), `16:00` = c(0, 2, 2), `16:15` = c(0, 2, 2), `16:30` = c(0, 
2, 2), `16:45` = c(0, 2, 2), `17:00` = c(0, 2, 2), `17:15` = c(0, 
2, 2), `17:30` = c(0, 2, 2), `17:45` = c(0, 2, 2), `18:00` = c(0, 
0, 2), `18:15` = c(0, 0, 2), `18:30` = c(0, 0, 0), `18:45` = c(0, 
0, 0), `19:00` = c(0, 0, 0), `19:15` = c(0, 0, 0), `19:30` = c(0, 
0, 0), `19:45` = c(0, 0, 0), `20:00` = c(0, 0, 0), `20:15` = c(0, 
0, 0), `20:30` = c(0, 0, 0), `20:45` = c(0, 0, 0), `21:00` = c(0, 
0, 0), `21:15` = c(0, 0, 0), `21:30` = c(0, 0, 0), `21:45` = c(0, 
0, 0), `22:00` = c(0, 0, 0), `22:15` = c(0, 0, 0), `22:30` = c(0, 
0, 0), `22:45` = c(0, 0, 0), `23:00` = c(0, 0, 0), `23:15` = c(0, 
0, 0), `23:30` = c(0, 0, 0), `23:45` = c(0, 0, 0), `00:00` = c(0, 
0, 0), `00:15` = c(0, 0, 0), `00:30` = c(0, 0, 0), `00:45` = c(0, 
0, 0), `01:00` = c(0, 0, 0), `01:15` = c(0, 0, 0), `01:30` = c(0, 
0, 0), `01:45` = c(0, 0, 0), `02:00` = c(0, 0, 0), `02:15` = c(0, 
0, 0), `02:30` = c(0, 0, 0), `02:45` = c(0, 0, 0), `03:00` = c(0, 
0, 0), `03:15` = c(0, 0, 0), `03:30` = c(0, 0, 0), `03:45` = c(0, 
0, 0), `04:00` = c(0, 0, 0), `04:15` = c(0, 0, 0), `04:30` = c(0, 
0, 0), `04:45` = c(0, 0, 0), `05:00` = c(0, 0, 0), `05:15` = c(0, 
0, 0), `05:30` = c(0, 0, 0), `05:45` = c(0, 0, 0), `06:00` = c(0, 
0, 0), `06:15` = c(0, 0, 0), `06:30` = c(0, 0, 0), `06:45` = c(0, 
0, 0), `07:00` = c(0, 0, 0), `07:15` = c(0, 0, 0), `07:30` = c(0, 
0, 0), `07:45` = c(0, 0, 0), `08:00` = c(0, 0, 2), `08:15` = c(0, 
0, 2), `08:30` = c(0, 0, 2), `08:45` = c(0, 0, 2), `09:00` = c(0, 
2, 2), `09:15` = c(0, 2, 2), `09:30` = c(0, 2, 2), `09:45` = c(0, 
2, 2), `10:00` = c(0, 2, 2), `10:15` = c(0, 2, 2), `10:30` = c(0, 
2, 2), `10:45` = c(0, 2, 2), `11:00` = c(0, 2, 2), `11:15` = c(0, 
2, 2), `11:30` = c(0, 2, 2), `11:45` = c(0, 2, 2), `12:00` = c(0, 
2, 2), `12:15` = c(0, 2, 2), `12:30` = c(0, 2, 2), `12:45` = c(0, 
2, 2), `13:00` = c(0, 2, 2), `13:15` = c(0, 2, 2), `13:30` = c(0, 
2, 2), `13:45` = c(0, 2, 2), `14:00` = c(0, 2, 2), `14:15` = c(0, 
2, 0), `14:30` = c(0, 2, 2), `14:45` = c(0, 2, 2), `15:00` = c(0, 
2, 2), `15:15` = c(0, 2, 2), `15:30` = c(0, 2, 2), `15:45` = c(0, 
2, 2), `16:00` = c(0, 2, 2), `16:15` = c(0, 2, 2), `16:30` = c(0, 
2, 2), `16:45` = c(0, 2, 2), `17:00` = c(0, 2, 2), `17:15` = c(0, 
2, 0), `17:30` = c(0, 2, 0), `17:45` = c(0, 2, 0), `18:00` = c(0, 
0, 0), `18:15` = c(0, 0, 0), `18:30` = c(0, 0, 0), `18:45` = c(0, 
0, 0), `19:00` = c(0, 0, 0), `19:15` = c(0, 0, 0), `19:30` = c(0, 
0, 0), `19:45` = c(0, 0, 0), `20:00` = c(0, 0, 0), `20:15` = c(0, 
0, 0), `20:30` = c(0, 0, 0), `20:45` = c(0, 0, 0), `21:00` = c(0, 
0, 0), `21:15` = c(0, 0, 0), `21:30` = c(0, 0, 0), `21:45` = c(0, 
0, 0), `22:00` = c(0, 0, 0), `22:15` = c(0, 0, 0), `22:30` = c(0, 
0, 0), `22:45` = c(0, 0, 0), `23:00` = c(0, 0, 0), `23:15` = c(0, 
0, 0), `23:30` = c(0, 0, 0), `23:45` = c(0, 0, 0), `00:00` = c(0, 
0, 0), `00:15` = c(0, 0, 0), `00:30` = c(0, 0, 0), `00:45` = c(0, 
0, 0), `01:00` = c(0, 0, 0), `01:15` = c(0, 0, 0), `01:30` = c(0, 
0, 0), `01:45` = c(0, 0, 0), `02:00` = c(0, 0, 0), `02:15` = c(0, 
0, 0), `02:30` = c(0, 0, 0), `02:45` = c(0, 0, 0), `03:00` = c(0, 
0, 0), `03:15` = c(0, 0, 0), `03:30` = c(0, 0, 0), `03:45` = c(0, 
0, 0), `04:00` = c(0, 0, 0), `04:15` = c(0, 0, 0), `04:30` = c(0, 
0, 0), `04:45` = c(0, 0, 0), `05:00` = c(0, 0, 0), `05:15` = c(0, 
0, 0), `05:30` = c(0, 0, 0), `05:45` = c(0, 0, 0), `06:00` = c(0, 
0, 0), `06:15` = c(0, 0, 0), `06:30` = c(0, 0, 0), `06:45` = c(0, 
0, 0), `07:00` = c(0, 0, 0), `07:15` = c(0, 0, 0), `07:30` = c(0, 
0, 0), `07:45` = c(0, 0, 0), `08:00` = c(0, 0, 0), `08:15` = c(0, 
0, 0), `08:30` = c(0, 0, 0), `08:45` = c(0, 0, 0), `09:00` = c(0, 
0, 0), `09:15` = c(0, 0, 0), `09:30` = c(0, 0, 0), `09:45` = c(0, 
0, 0), `10:00` = c(0, 0, 0), `10:15` = c(0, 0, 0), `10:30` = c(0, 
0, 0), `10:45` = c(0, 0, 0), `11:00` = c(0, 0, 0), `11:15` = c(0, 
0, 0), `11:30` = c(0, 0, 0), `11:45` = c(0, 0, 0), `12:00` = c(0, 
0, 0), `12:15` = c(0, 0, 0), `12:30` = c(0, 0, 0), `12:45` = c(0, 
0, 0), `13:00` = c(0, 0, 0), `13:15` = c(0, 0, 0), `13:30` = c(0, 
0, 0), `13:45` = c(0, 0, 0), `14:00` = c(0, 0, 0), `14:15` = c(0, 
0, 0), `14:30` = c(0, 0, 0), `14:45` = c(0, 0, 0), `15:00` = c(0, 
0, 0), `15:15` = c(0, 0, 0), `15:30` = c(0, 0, 0), `15:45` = c(0, 
0, 0), `16:00` = c(0, 0, 0), `16:15` = c(0, 0, 0), `16:30` = c(0, 
0, 0), `16:45` = c(0, 0, 0), `17:00` = c(0, 0, 0), `17:15` = c(0, 
0, 0), `17:30` = c(0, 0, 0), `17:45` = c(0, 0, 0), `18:00` = c(0, 
0, 0), `18:15` = c(0, 0, 0), `18:30` = c(0, 0, 0), `18:45` = c(0, 
0, 0), `19:00` = c(0, 0, 0), `19:15` = c(0, 0, 0), `19:30` = c(0, 
0, 0), `19:45` = c(0, 0, 0), `20:00` = c(0, 0, 0), `20:15` = c(0, 
0, 0), `20:30` = c(0, 0, 0), `20:45` = c(0, 0, 0), `21:00` = c(0, 
0, 0), `21:15` = c(0, 0, 0), `21:30` = c(0, 0, 0), `21:45` = c(0, 
0, 0), `22:00` = c(0, 0, 0), `22:15` = c(0, 0, 0), `22:30` = c(0, 
0, 0), `22:45` = c(0, 0, 0), `23:00` = c(0, 0, 0), `23:15` = c(0, 
0, 0), `23:30` = c(0, 0, 0), `23:45` = c(0, 0, 0), `00:00` = c(0, 
0, 0), `00:15` = c(0, 0, 0), `00:30` = c(0, 0, 0), `00:45` = c(0, 
0, 0), `01:00` = c(0, 0, 0), `01:15` = c(0, 0, 0), `01:30` = c(0, 
0, 0), `01:45` = c(0, 0, 0), `02:00` = c(0, 0, 0), `02:15` = c(0, 
0, 0), `02:30` = c(0, 0, 0), `02:45` = c(0, 0, 0), `03:00` = c(0, 
0, 0), `03:15` = c(0, 0, 0), `03:30` = c(0, 0, 0), `03:45` = c(0, 
0, 0), `04:00` = c(0, 0, 0), `04:15` = c(0, 0, 0), `04:30` = c(0, 
0, 0), `04:45` = c(0, 0, 0), `05:00` = c(0, 0, 0), `05:15` = c(0, 
0, 0), `05:30` = c(0, 0, 0), `05:45` = c(0, 0, 0), `06:00` = c(0, 
0, 0), `06:15` = c(0, 0, 0), `06:30` = c(0, 0, 0), `06:45` = c(0, 
0, 0), `07:00` = c(0, 0, 0), `07:15` = c(0, 0, 0), `07:30` = c(0, 
0, 0), `07:45` = c(0, 0, 0), `08:00` = c(0, 0, 0), `08:15` = c(0, 
0, 0), `08:30` = c(0, 0, 0), `08:45` = c(0, 0, 0), `09:00` = c(0, 
0, 0), `09:15` = c(0, 0, 0), `09:30` = c(0, 0, 0), `09:45` = c(0, 
0, 0), `10:00` = c(0, 0, 0), `10:15` = c(0, 0, 0), `10:30` = c(0, 
0, 0), `10:45` = c(0, 0, 0), `11:00` = c(0, 0, 0), `11:15` = c(0, 
0, 0), `11:30` = c(0, 0, 0), `11:45` = c(0, 0, 0), `12:00` = c(0, 
0, 0), `12:15` = c(0, 0, 0), `12:30` = c(0, 0, 0), `12:45` = c(0, 
0, 0), `13:00` = c(0, 0, 0), `13:15` = c(0, 0, 0), `13:30` = c(0, 
0, 0), `13:45` = c(0, 0, 0), `14:00` = c(0, 0, 0), `14:15` = c(0, 
0, 0), `14:30` = c(0, 0, 0), `14:45` = c(0, 0, 0), `15:00` = c(0, 
0, 0), `15:15` = c(0, 0, 0), `15:30` = c(0, 0, 0), `15:45` = c(0, 
0, 0), `16:00` = c(0, 0, 0), `16:15` = c(0, 0, 0), `16:30` = c(0, 
0, 0), `16:45` = c(0, 0, 0), `17:00` = c(0, 0, 0), `17:15` = c(0, 
0, 0), `17:30` = c(0, 0, 0), `17:45` = c(0, 0, 0), `18:00` = c(0, 
0, 0), `18:15` = c(0, 0, 0), `18:30` = c(0, 0, 0), `18:45` = c(0, 
0, 0), `19:00` = c(0, 0, 0), `19:15` = c(0, 0, 0), `19:30` = c(0, 
0, 0), `19:45` = c(0, 0, 0), `20:00` = c(0, 0, 0), `20:15` = c(0, 
0, 0), `20:30` = c(0, 0, 0), `20:45` = c(0, 0, 0), `21:00` = c(0, 
0, 0), `21:15` = c(0, 0, 0), `21:30` = c(0, 0, 0), `21:45` = c(0, 
0, 0), `22:00` = c(0, 0, 0), `22:15` = c(0, 0, 0), `22:30` = c(0, 
0, 0), `22:45` = c(0, 0, 0), `23:00` = c(0, 0, 0), `23:15` = c(0, 
0, 0), `23:30` = c(0, 0, 0), `23:45` = c(0, 0, 0), `00:00` = c(0, 
0, 0), `00:15` = c(0, 0, 0), `00:30` = c(0, 0, 0), `00:45` = c(0, 
0, 0), `01:00` = c(0, 0, 0), `01:15` = c(0, 0, 0), `01:30` = c(0, 
0, 0), `01:45` = c(0, 0, 0), `02:00` = c(0, 0, 0), `02:15` = c(0, 
0, 0), `02:30` = c(0, 0, 0), `02:45` = c(0, 0, 0), `03:00` = c(0, 
0, 0), `03:15` = c(0, 0, 0), `03:30` = c(0, 0, 0), `03:45` = c(0, 
0, 0)), row.names = c(NA, 3L), class = "data.frame")

Каждая строка в df представляет временной шаг (время начала 04:00, время окончания 03:45, измеренное в 14 минутах) и тамСемь дней начинаются с понедельника.

Я хотел бы создать график типа тепловой карты, используя geom_tile (или geom_raster или geom_rect).

Я хотел бы изменить ось x (чтобы добавить разрывы), а также ось y(заменить идентификационным номером).

К сожалению, данные, которые я использую, похоже, не работают, я думаю.Я пытался создать сюжет, используя все три геометрии, но без особого успеха.

Это единственный график, который мне удалось создать.

Matrix image

Как изменить этот график, чтобы он представлял профили ежедневных профилей?

enter image description here

Спасибо

1 Ответ

0 голосов
/ 29 апреля 2019

Вот подход, использующий некоторые споры для преобразования из матрицы в фрейм данных и преобразования строк символов времени в «десятичный час с 4 утра».

TiNiSWeek %>%
  rowid_to_column() %>%
  as_tibble() %>%
  gather(time, val, -rowid) %>% 
  mutate(day = rep(weekdays, each = 96*3) %>% fct_relevel(weekdays),
         time_hm = hm(str_sub(time, end = 5)),
         time_dec_from_start = hour(time_hm) + minute(time_hm)/60 - 4) %>%       
  ggplot(aes(time_dec_from_start, rowid, fill = val)) +
  geom_tile() +
  facet_wrap(~day)

enter image description here

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...