PATCHWORK KLUSÁČKOVÁ, MATÝSKOVÁ, ZÁBOJNÍK PATCHWORK PATCHWORK ▸ Autor: Thomas Lin Pedersen ▸ Patchwork je balíček, který je určen pro uživatele ggplotu2. ▸ Patchwork se používá k uspořádání grafů. PATCHWORK PŘÍKLADY library(ggplot2) library(patchwork) p1 <- ggplot(mtcars) + geom_point(aes(mpg, disp)) + ggtitle('Plot 1’) p2 <- ggplot(mtcars) + geom_boxplot(aes(gear, disp, group = gear)) + ggtitle('Plot 2') p3 <- ggplot(mtcars) + geom_point(aes(hp, wt, colour = mpg)) + ggtitle('Plot 3’) p4 <- ggplot(mtcars) + geom_bar(aes(gear)) + facet_wrap(~cyl) + ggtitle('Plot 4') PATCHWORK p1 + p2 PATCHWORK p1 + p2 + p3 + p4 PATCHWORK p1 + p2 + p3 + p4 + plot_layout(nrow = 3, byrow = FALSE) PATCHWORK p1 / p2 PATCHWORK p1 | (p2 / p3) PATCHWORK (p1 | (p2 / p3)) + plot_annotation(title = 'The surprising story about mtcars')