I want to produce individual plot objects based on a factor so that i can plot them together using grid_arrange rather than facet_grid - as i find that clunky.
I imagine I need a for loop but i dont quite understand them - if that is what I need can you detail how it works a little.
p <- ggplot(All, aes(x=variable, y=value, fill = Type))
p <- p + geom_bar(stat="identity" ) + facet_grid(~ Month)
p
#dummy data
All <- structure(list(Type = structure(c(5L, 5L, 5L, 5L, 5L, 5L,
5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 7L, 7L,
7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L), .Label = c("Cargo ship", "Cargo ship:DG,HS,MP(A)",
"Cargo ship:DG,HS,MP(B)", "Cargo ship:DG,HS,MP(D)", "Fishing",
"Other:DG,HS,MP(B)", "Tanker", "Tanker:DG,HS,MP(B)"), class =
"factor"),
Month = c("Jan", "Jan", "Jan", "Nov", "Jan", "Jan", "Jan",
"Nov", "Jan", "Mar", "Jan", "Jan", "Jan", "Jan", "Jan", "Nov",
"Jan", "Mar", "Nov", "Mar", "Mar", "Feb", "Mar", "Mar", "Nov",
"Nov", "Jan", "Feb", "Mar", "Mar", "Nov", "Nov", "Dec", "Dec",
"Dec", "Dec", "Jan", "Jan", "Jan", "Jan", "Jan", "Jan", "Jan"
), Year = c(2019, 2019, 2019, 2018, 2019, 2019, 2019, 2018,
2019, 2019, 2019, 2019, 2019, 2019, 2019, 2018, 2019, 2019,
2018, 2019, 2019, 2019, 2019, 2019, 2018, 2018, 2019, 2019,
2019, 2019, 2018, 2018, 2018, 2018, 2018, 2018, 2019, 2019,
2019, 2019, 2019, 2019, 2019), variable = structure(c(4L,
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L,
3L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), .Label = c("0-12",
"0-25", "0-50", "0-100"), class = "factor"), value = c(1,
0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
0, 0, 0, 0)), row.names = c(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L,
9L, 10L, 360L, 361L, 362L, 363L, 364L, 365L, 366L, 367L, 368L,
369L, 370L, 3300L, 3301L, 3302L, 3303L, 3304L, 3305L, 3306L,
3307L, 3308L, 3309L, 3310L, 2460L, 2461L, 2462L, 2463L, 2464L,
2465L, 2466L, 2467L, 2468L, 2469L, 2470L), class = "data.frame")
I would like multiple plot objects for each month in the data set.

