How to plot using facet_wrap, over multiple pages as a .pdf files in r cran
I am using ggplot, to compare 114 unique studies for a particular variable I'm interested in.
This is what I have used.
ggplot(steps, aes(x=factor(edu))) + geom_bar(aes(y = (..count..), group = id_study,)) + facet_wrap(~id_study,)
Whilst this works, all 114 studies are plotted on one page and the formatting is all squashed. How do I split this over 4x4 pages ?
Many thanks
S
edit ****
As there are 114 unique studies, I have 5 pages in total
1)
ggplot(steps, aes(x=factor(edu))) + geom_bar(aes(y = (..count..), group = id_study,))+ facet_wrap_paginate(~id_study, nrow = 5, ncol = 5, scales
= fixed, shrink = TRUE, labeller = label_value, as.table = TRUE, switch = NULL, drop = TRUE, dir = h, strip.position = top, page = 1)
2)
ggplot(steps, aes(x=factor(edu))) + geom_bar(aes(y = (..count..), group = id_study,))+ facet_wrap_paginate(~id_study, nrow = 5, ncol = 5, scales
= fixed, shrink = TRUE, labeller = label_value, as.table = TRUE, switch = NULL, drop = TRUE, dir = h, strip.position = top, page = 2)
3)
ggplot(steps, aes(x=factor(edu))) + geom_bar(aes(y = (..count..), group = id_study,))+ facet_wrap_paginate(~id_study, nrow = 5, ncol = 5, scales
= fixed, shrink = TRUE, labeller = label_value, as.table = TRUE, switch = NULL, drop = TRUE, dir = h, strip.position = top, page = 3)
4)
ggplot(steps, aes(x=factor(edu))) + geom_bar(aes(y = (..count..), group = id_study,))+ facet_wrap_paginate(~id_study, nrow = 5, ncol = 5, scales
= fixed, shrink = TRUE, labeller = label_value, as.table = TRUE, switch = NULL, drop = TRUE, dir = h, strip.position = top, page = 4)
5)
ggplot(steps, aes(x=factor(edu))) + geom_bar(aes(y = (..count..), group = id_study,))+ facet_wrap_paginate(~id_study, nrow = 5, ncol = 5, scales
= fixed, shrink = TRUE, labeller = label_value, as.table = TRUE, switch = NULL, drop = TRUE, dir = h, strip.position = top, page = 5)
all of these into 1 page?
thank you
Topic plotting ggplot2 data r data-mining
Category Data Science