Я создал фасетный график (см. Рисунок ниже), и я хотел бы изменить отображение так, чтобы две переменные ("final.score.new" и "total.score.r.new") были объединены вместе (один под другим для каждого идентификатора), а не рядом друг с другом, как показано ниже.
Это мой текущий код:
ggplot(data, aes(xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, fill=score_value)) +
theme_bw() + guides(fill=guide_legend(title=NULL)) +
geom_rect(colour = "black", size = 0.5) +
facet_grid(id ~score_type) +
theme(axis.ticks.y=element_blank(), axis.text.y=element_blank())
Вот некоторые примеры данных:
data <- - read_table2("id score_type score_value ymin ymax freq xmax xmin
Adam Ferari Rank>10 0 0.01 1 1 0
Adam Honda car1 0 0.01 1 1 0
Adam Ferari Rank>10 0 0.01 1 2 1
Adam Honda car2 0 0.01 1 2 1
Adam Ferari Rank>10 0 0.01 1 3 2
Adam Honda car2 0 0.01 1 3 2
Adam Ferari Rank>10 0 0.01 1 4 3
Adam Honda car2 0 0.01 1 4 3
Adam Ferari Rank>10 0 0.01 1 5 4
Adam Honda car2 0 0.01 1 5 4
Adam Ferari Rank>10 0 0.01 1 6 5
Adam Honda car2 0 0.01 1 6 5
Adam Ferari Rank>10 0 0.01 1 7 6
Adam Honda car2 0 0.01 1 7 6
Adam Ferari GameBreak 0 0.01 0.5 7.5 7
Adam Honda GameBreak 0 0.01 0.5 7.5 7
Adam Ferari GameBreak 0 0.01 0.5 23 22.5
Adam Honda GameBreak 0 0.01 0.5 23 22.5
Adam Ferari GameBreak 0 0.01 0.5 58.5 58
Adam Honda GameBreak 0 0.01 0.5 58.5 58
Adam Ferari Rank>10 0 0.01 1 8.5 7.5
Adam Honda car5 0 0.01 1 8.5 7.5
Adam Ferari Rank>10 0 0.01 1 9.5 8.5
Adam Honda car2 0 0.01 1 9.5 8.5
Adam Ferari NA 0 0.01 1 10.5 9.5
Adam Honda car2 0 0.01 1 10.5 9.5
Adam Ferari NA 0 0.01 1 11.5 10.5
Adam Honda car2 0 0.01 1 11.5 10.5
Adam Ferari NA 0 0.01 1 12.5 11.5
Adam Honda car5 0 0.01 1 12.5 11.5
Adam Ferari NA 0 0.01 1 13.5 12.5
Adam Honda car2 0 0.01 1 13.5 12.5
Adam Ferari NA 0 0.01 1 14.5 13.5
Adam Honda car2 0 0.01 1 14.5 13.5
Adam Ferari NA 0 0.01 1 15.5 14.5
Adam Honda car3 0 0.01 1 15.5 14.5
Adam Ferari Rank=1 0 0.01 1 16.5 15.5
Adam Honda car5 0 0.01 1 16.5 15.5
Adam Ferari NA 0 0.01 1 17.5 16.5
Adam Honda car2 0 0.01 1 17.5 16.5
Adam Ferari 2<=Rank<=10 0 0.01 1 18.5 17.5
Adam Honda car2 0 0.01 1 18.5 17.5
Adam Ferari Rank=1 0 0.01 1 19.5 18.5
Adam Honda car2 0 0.01 1 19.5 18.5
Adam Ferari Rank=1 0 0.01 1 20.5 19.5
Adam Honda car1 0 0.01 1 20.5 19.5
Adam Ferari Rank>10 0 0.01 1 21.5 20.5
Adam Honda car5 0 0.01 1 21.5 20.5
Adam Ferari Rank=1 0 0.01 1 22.5 21.5
Adam Honda car2 0 0.01 1 22.5 21.5
Adam Ferari GameBreak 0 0.01 0.5 7.5 7
Adam Honda GameBreak 0 0.01 0.5 7.5 7
Adam Ferari GameBreak 0 0.01 0.5 23 22.5
Adam Honda GameBreak 0 0.01 0.5 23 22.5
Adam Ferari GameBreak 0 0.01 0.5 58.5 58
Adam Honda GameBreak 0 0.01 0.5 58.5 58
Adam Ferari Rank=1 0 0.01 1 24 23
Adam Honda car3 0 0.01 1 24 23
Adam Ferari Rank=1 0 0.01 1 25 24
Adam Honda car3 0 0.01 1 25 24
Adam Ferari Rank=1 0 0.01 1 26 25
Adam Honda car2 0 0.01 1 26 25
Adam Ferari Rank=1 0 0.01 1 27 26
Adam Honda car2 0 0.01 1 27 26
Adam Ferari NA 0 0.01 1 28 27
Adam Honda car1 0 0.01 1 28 27
Adam Ferari NA 0 0.01 1 29 28
Adam Honda car3 0 0.01 1 29 28
Adam Ferari Rank=1 0 0.01 1 30 29
Adam Honda car2 0 0.01 1 30 29
Adam Ferari gameWin 0 0.01 1 31 30
Adam Honda gameWin 0 0.01 1 31 30
Adam Ferari NA 0 0.01 1 32 31
Adam Honda car2 0 0.01 1 32 31
Adam Ferari NA 0 0.01 1 33 32
Adam Honda car2 0 0.01 1 33 32
Adam Ferari NA 0 0.01 1 34 33
Adam Honda car5 0 0.01 1 34 33
Adam Ferari gameLose_noCash 0 0.01 1 35 34
Adam Honda gameLose_noCash 0 0.01 1 35 34
Adam Ferari NA 0 0.01 1 36 35
Adam Honda car2 0 0.01 1 36 35
Adam Ferari Rank>10 0 0.01 1 37 36
Adam Honda car2 0 0.01 1 37 36
Adam Ferari Rank>10 0 0.01 1 38 37
Adam Honda car1 0 0.01 1 38 37
Adam Ferari Rank>10 0 0.01 1 39 38
Adam Honda car5 0 0.01 1 39 38
Adam Ferari Rank>10 0 0.01 1 40 39
Adam Honda car4 0 0.01 1 40 39
Adam Ferari Rank>10 0 0.01 1 41 40
Adam Honda car1 0 0.01 1 41 40
Adam Ferari Rank>10 0 0.01 1 42 41
Adam Honda car5 0 0.01 1 42 41
Adam Ferari Rank>10 0 0.01 1 43 42
Adam Honda car1 0 0.01 1 43 42
Adam Ferari Rank>10 0 0.01 1 44 43
Adam Honda car5 0 0.01 1 44 43
Adam Ferari Rank>10 0 0.01 1 45 44
Adam Honda car1 0 0.01 1 45 44
Adam Ferari Rank>10 0 0.01 1 46 45
Adam Honda car2 0 0.01 1 46 45
Adam Ferari Rank>10 0 0.01 1 47 46
Adam Honda car5 0 0.01 1 47 46
Adam Ferari NA 0 0.01 1 48 47
Adam Honda car4 0 0.01 1 48 47
Adam Ferari NA 0 0.01 1 49 48
Adam Honda car1 0 0.01 1 49 48
Adam Ferari NA 0 0.01 1 50 49
Adam Honda car2 0 0.01 1 50 49
Adam Ferari NA 0 0.01 1 51 50
Adam Honda car3 0 0.01 1 51 50
Adam Ferari NA 0 0.01 1 52 51
Adam Honda car5 0 0.01 1 52 51
Adam Ferari 2<=Rank<=10 0 0.01 1 53 52
Adam Honda car4 0 0.01 1 53 52
Adam Ferari 2<=Rank<=10 0 0.01 1 54 53
Adam Honda car2 0 0.01 1 54 53
Adam Ferari 2<=Rank<=10 0 0.01 1 55 54
Adam Honda car2 0 0.01 1 55 54
Adam Ferari NA 0 0.01 1 56 55
Adam Honda car2 0 0.01 1 56 55
Adam Ferari NA 0 0.01 1 57 56
Adam Honda car4 0 0.01 1 57 56
Adam Ferari gameWin 0 0.01 1 58 57
Adam Honda gameWin 0 0.01 1 58 57
Adam Ferari GameBreak 0 0.01 0.5 7.5 7
Adam Honda GameBreak 0 0.01 0.5 7.5 7
Adam Ferari GameBreak 0 0.01 0.5 23 22.5
Adam Honda GameBreak 0 0.01 0.5 23 22.5
Adam Ferari GameBreak 0 0.01 0.5 58.5 58
Adam Honda GameBreak 0 0.01 0.5 58.5 58
Adam Ferari Rank>10 0 0.01 1 59.5 58.5
Adam Honda car3 0 0.01 1 59.5 58.5
Adam Ferari Rank>10 0 0.01 1 60.5 59.5
Adam Honda car4 0 0.01 1 60.5 59.5
Adam Ferari Rank>10 0 0.01 1 61.5 60.5
Adam Honda car5 0 0.01 1 61.5 60.5
Adam Ferari Rank>10 0 0.01 1 62.5 61.5
Adam Honda car2 0 0.01 1 62.5 61.5
Adam Ferari Rank>10 0 0.01 1 63.5 62.5
Adam Honda car5 0 0.01 1 63.5 62.5
Adam Ferari Rank>10 0 0.01 1 64.5 63.5
Adam Honda car4 0 0.01 1 64.5 63.5
Adam Ferari Rank>10 0 0.01 1 65.5 64.5
Adam Honda car1 0 0.01 1 65.5 64.5
Adam Ferari NA 0 0.01 1 66.5 65.5
Adam Honda car2 0 0.01 1 66.5 65.5
Adam Ferari NA 0 0.01 1 67.5 66.5
Adam Honda car5 0 0.01 1 67.5 66.5
Adam Ferari NA 0 0.01 1 68.5 67.5
Adam Honda car4 0 0.01 1 68.5 67.5
Adam Ferari NA 0 0.01 1 69.5 68.5
Adam Honda car3 0 0.01 1 69.5 68.5
Adam Ferari NA 0 0.01 1 70.5 69.5
Adam Honda car1 0 0.01 1 70.5 69.5
Adam Ferari Rank=1 0 0.01 1 71.5 70.5
Adam Honda car2 0 0.01 1 71.5 70.5
Adam Ferari 2<=Rank<=10 0 0.01 1 72.5 71.5
Adam Honda car1 0 0.01 1 72.5 71.5
Adam Ferari Rank=1 0 0.01 1 73.5 72.5
Adam Honda car5 0 0.01 1 73.5 72.5
Adam Ferari Rank=1 0 0.01 1 74.5 73.5
Adam Honda car2 0 0.01 1 74.5 73.5
Adam Ferari Rank=1 0 0.01 1 75.5 74.5
Adam Honda car5 0 0.01 1 75.5 74.5
Adam Ferari Rank=1 0 0.01 1 76.5 75.5
Adam Honda car1 0 0.01 1 76.5 75.5
Adam Ferari Rank=1 0 0.01 1 77.5 76.5
Adam Honda car2 0 0.01 1 77.5 76.5
Adam Ferari NA 0 0.01 1 78.5 77.5
Adam Honda car3 0 0.01 1 78.5 77.5
Adam Ferari NA 0 0.01 1 79.5 78.5
Adam Honda car2 0 0.01 1 79.5 78.5
Adam Ferari gameWin 0 0.01 1 80.5 79.5
Adam Honda gameWin 0 0.01 1 80.5 79.5
Adam Ferari Rank>10 0 0.01 1 81.5 80.5
Adam Honda car2 0 0.01 1 81.5 80.5
Adam Ferari Rank>10 0 0.01 1 82.5 81.5
Adam Honda car2 0 0.01 1 82.5 81.5
Adam Ferari NA 0 0.01 1 83.5 82.5
Adam Honda car2 0 0.01 1 83.5 82.5
Adam Ferari NA 0 0.01 1 84.5 83.5
Adam Honda car2 0 0.01 1 84.5 83.5
Sarah Ferari NA 0 0.01 1 1 0
Sarah Honda car4 0 0.01 1 1 0
Sarah Ferari NA 0 0.01 1 2 1
Sarah Honda car2 0 0.01 1 2 1
Sarah Ferari NA 0 0.01 1 3 2
Sarah Honda car3 0 0.01 1 3 2
Sarah Ferari gameLose_noCash 0 0.01 1 4 3
Sarah Honda gameLose_noCash 0 0.01 1 4 3
Sarah Ferari Rank>10 0 0.01 1 5 4
Sarah Honda car1 0 0.01 1 5 4
Sarah Ferari Rank>10 0 0.01 1 6 5
Sarah Honda car2 0 0.01 1 6 5
Sarah Ferari Rank>10 0 0.01 1 7 6
Sarah Honda car2 0 0.01 1 7 6
Sarah Ferari Rank>10 0 0.01 1 8 7
Sarah Honda car1 0 0.01 1 8 7
Sarah Ferari Rank>10 0 0.01 1 9 8
Sarah Honda car2 0 0.01 1 9 8
Sarah Ferari Rank>10 0 0.01 1 10 9
Sarah Honda car2 0 0.01 1 10 9
Sarah Ferari Rank>10 0 0.01 1 11 10
Sarah Honda car1 0 0.01 1 11 10
Sarah Ferari Rank>10 0 0.01 1 12 11
Sarah Honda car2 0 0.01 1 12 11
Sarah Ferari GameBreak 0 0.01 0.5 12.5 12
Sarah Honda GameBreak 0 0.01 0.5 12.5 12
Sarah Ferari GameBreak 0 0.01 0.5 32 31.5
Sarah Honda GameBreak 0 0.01 0.5 32 31.5
Sarah Ferari GameBreak 0 0.01 0.5 45.5 45
Sarah Honda GameBreak 0 0.01 0.5 45.5 45
Sarah Ferari Rank>10 0 0.01 1 13.5 12.5
Sarah Honda car2 0 0.01 1 13.5 12.5
Sarah Ferari Rank>10 0 0.01 1 14.5 13.5
Sarah Honda car1 0 0.01 1 14.5 13.5
Sarah Ferari Rank>10 0 0.01 1 15.5 14.5
Sarah Honda car2 0 0.01 1 15.5 14.5
Sarah Ferari Rank>10 0 0.01 1 16.5 15.5
Sarah Honda car2 0 0.01 1 16.5 15.5
Sarah Ferari Rank>10 0 0.01 1 17.5 16.5
Sarah Honda car2 0 0.01 1 17.5 16.5
Sarah Ferari NA 0 0.01 1 18.5 17.5
Sarah Honda car2 0 0.01 1 18.5 17.5
Sarah Ferari NA 0 0.01 1 19.5 18.5
Sarah Honda car2 0 0.01 1 19.5 18.5
Sarah Ferari NA 0 0.01 1 20.5 19.5
Sarah Honda car2 0 0.01 1 20.5 19.5
Sarah Ferari NA 0 0.01 1 21.5 20.5
Sarah Honda car2 0 0.01 1 21.5 20.5
Sarah Ferari Rank=1 0 0.01 1 22.5 21.5
Sarah Honda car2 0 0.01 1 22.5 21.5
Sarah Ferari Rank=1 0 0.01 1 23.5 22.5
Sarah Honda car2 0 0.01 1 23.5 22.5
Sarah Ferari Rank=1 0 0.01 1 24.5 23.5
Sarah Honda car2 0 0.01 1 24.5 23.5
Sarah Ferari Rank=1 0 0.01 1 25.5 24.5
Sarah Honda car2 0 0.01 1 25.5 24.5
Sarah Ferari NA 0 0.01 1 26.5 25.5
Sarah Honda car1 0 0.01 1 26.5 25.5
Sarah Ferari NA 0 0.01 1 27.5 26.5
Sarah Honda car2 0 0.01 1 27.5 26.5
Sarah Ferari gameWin 0 0.01 1 28.5 27.5
Sarah Honda gameWin 0 0.01 1 28.5 27.5
Sarah Ferari Rank>10 0 0.01 1 29.5 28.5
Sarah Honda car2 0 0.01 1 29.5 28.5
Sarah Ferari Rank>10 0 0.01 1 30.5 29.5
Sarah Honda car4 0 0.01 1 30.5 29.5
Sarah Ferari NA 0 0.01 1 31.5 30.5
Sarah Honda car2 0 0.01 1 31.5 30.5
Sarah Ferari GameBreak 0 0.01 0.5 12.5 12
Sarah Honda GameBreak 0 0.01 0.5 12.5 12
Sarah Ferari GameBreak 0 0.01 0.5 32 31.5
Sarah Honda GameBreak 0 0.01 0.5 32 31.5
Sarah Ferari GameBreak 0 0.01 0.5 45.5 45
Sarah Honda GameBreak 0 0.01 0.5 45.5 45
Sarah Ferari Rank>10 0 0.01 1 33 32
Sarah Honda car2 0 0.01 1 33 32
Sarah Ferari Rank>10 0 0.01 1 34 33
Sarah Honda car2 0 0.01 1 34 33
Sarah Ferari Rank>10 0 0.01 1 35 34
Sarah Honda car2 0 0.01 1 35 34
Sarah Ferari Rank>10 0 0.01 1 36 35
Sarah Honda car5 0 0.01 1 36 35
Sarah Ferari Rank>10 0 0.01 1 37 36
Sarah Honda car3 0 0.01 1 37 36
Sarah Ferari Rank>10 0 0.01 1 38 37
Sarah Honda car2 0 0.01 1 38 37
Sarah Ferari Rank>10 0 0.01 1 39 38
Sarah Honda car5 0 0.01 1 39 38
Sarah Ferari NA 0 0.01 1 40 39
Sarah Honda car1 0 0.01 1 40 39
Sarah Ferari Rank>10 0 0.01 1 41 40
Sarah Honda car2 0 0.01 1 41 40
Sarah Ferari NA 0 0.01 1 42 41
Sarah Honda car5 0 0.01 1 42 41
Sarah Ferari Rank>10 0 0.01 1 43 42
Sarah Honda car3 0 0.01 1 43 42
Sarah Ferari NA 0 0.01 1 44 43
Sarah Honda car1 0 0.01 1 44 43
Sarah Ferari NA 0 0.01 1 45 44
Sarah Honda car2 0 0.01 1 45 44
Sarah Ferari GameBreak 0 0.01 0.5 12.5 12
Sarah Honda GameBreak 0 0.01 0.5 12.5 12
Sarah Ferari GameBreak 0 0.01 0.5 32 31.5
Sarah Honda GameBreak 0 0.01 0.5 32 31.5
Sarah Ferari GameBreak 0 0.01 0.5 45.5 45
Sarah Honda GameBreak 0 0.01 0.5 45.5 45
Sarah Ferari Rank=1 0 0.01 1 46.5 45.5
Sarah Honda car3 0 0.01 1 46.5 45.5
Sarah Ferari Rank=1 0 0.01 1 47.5 46.5
Sarah Honda car2 0 0.01 1 47.5 46.5
Sarah Ferari Rank=1 0 0.01 1 48.5 47.5
Sarah Honda car1 0 0.01 1 48.5 47.5
Sarah Ferari Rank=1 0 0.01 1 49.5 48.5
Sarah Honda car5 0 0.01 1 49.5 48.5
Sarah Ferari Rank=1 0 0.01 1 50.5 49.5
Sarah Honda car2 0 0.01 1 50.5 49.5
Sarah Ferari Rank=1 0 0.01 1 51.5 50.5
Sarah Honda car3 0 0.01 1 51.5 50.5
Sarah Ferari Rank=1 0 0.01 1 52.5 51.5
Sarah Honda car1 0 0.01 1 52.5 51.5
Sarah Ferari Rank=1 0 0.01 1 53.5 52.5
Sarah Honda car2 0 0.01 1 53.5 52.5
Sarah Ferari NA 0 0.01 1 54.5 53.5
Sarah Honda car3 0 0.01 1 54.5 53.5
Sarah Ferari NA 0 0.01 1 55.5 54.5
Sarah Honda car1 0 0.01 1 55.5 54.5
Sarah Ferari gameWin 0 0.01 1 56.5 55.5
Sarah Honda gameWin 0 0.01 1 56.5 55.5
Sarah Ferari Rank>10 0 0.01 1 57.5 56.5
Sarah Honda car4 0 0.01 1 57.5 56.5
Sarah Ferari Rank>10 0 0.01 1 58.5 57.5
Sarah Honda car1 0 0.01 1 58.5 57.5
Sarah Ferari Rank>10 0 0.01 1 59.5 58.5
Sarah Honda car5 0 0.01 1 59.5 58.5
Sarah Ferari NA 0 0.01 1 60.5 59.5
Sarah Honda car5 0 0.01 1 60.5 59.5
Sarah Ferari NA 0 0.01 1 61.5 60.5
Sarah Honda car4 0 0.01 1 61.5 60.5
Sarah Ferari NA 0 0.01 1 62.5 61.5
Sarah Honda car1 0 0.01 1 62.5 61.5
")
Любые предложения будут оценены!
Хотелось бы отформатировать его так: