Add facet_wrap(~ month)
or facet_grid(month ~ .)
at the end of your plotting code. You can also specify the number of columns in facet_wrap
: facet_wrap(~ month, ncol = 3)
I've rearranged your data:
- transposed the data
- named the first column
place
The resulting dataframe:
oklahoma <- structure(list(place = structure(1:44, .Label = c("Ada", "Altus", "Antlers", "Ardmore", "Bartlesville", "Beaver", "Boise City", "Buffalo", "Carnegie", "Cherokee", "Claremore", "Durant", "Enid", "Erick", "Geary", "Goodwell", "Guthrie", "Hammon", "Hennessey", "Hobartmuni", "Holdenville", "Hooker", "Jefferson", "Kenton", "Kingfisher", "Lawton", "Mangum", "Meeker", "Miami", "Muskogee", "Mutual", "Newkirk", "Okeene", "Okemah", "Okmulgee", "Pauls valley", "Pawhuska", "Perry", "Poteau", "Stillwater", "Tahlequah", "Waurika", "Weatherford", "Webbersfalls"), class = "factor"), Jan = structure(c(16L, 12L, 5L, 1L, 2L, 7L, 8L, 4L, 8L, 12L, 2L, 12L, 16L, 11L, 1L, 6L, 12L, 8L, 8L, 3L, 4L, 9L, 10L, 8L, 11L, 9L, 7L, 3L, 3L, 14L, 10L, 4L, 15L, 6L, 10L, 17L, 11L, 10L, 3L, 10L, 15L, 13L, 9L, 4L), .Label = c("-0,01", "-0,02", "-0,03", "-0,04", "-0,08", "0", "0,01", "0,02", "0,03", "0,04", "0,05", "0,06", "0,07", "0,08", "0,09", "0,1", "0,17"), class = "factor"), Feb = structure(c(17L, 10L, 7L, 12L, 12L, 1L, 3L, 5L, 11L, 13L, 21L, 10L, 13L, 11L, 6L, 3L, 16L, 8L, 12L, 1L, 15L, 2L, 10L, 4L, 12L, 11L, 5L, 17L, 8L, 15L, 10L, 11L, 19L, 9L, 20L, 18L, 14L, 16L, 10L, 15L, 18L, 9L, 10L, 13L), .Label = c("-0,02", "-0,03", "-0,05", "-0,06", "0", "0,01", "0,02", "0,03", "0,04", "0,05", "0,06", "0,09", "0,1", "0,11", "0,12", "0,13", "0,14", "0,17", "0,19", "0,21", "0,22"), class = "factor"), Mar = structure(c(18L, 6L, 6L, 12L, 14L, 10L, 5L, 9L, 9L, 19L, 12L, 9L, 22L, 8L, 9L, 4L, 17L, 8L, 16L, 6L, 19L, 3L, 21L, 1L, 12L, 2L, 1L, 16L, 11L, 8L, 10L, 13L, 7L, 14L, 11L, 23L, 22L, 18L, 15L, 10L, 20L, 10L, 17L, 10L), .Label = c("0,05", "0,06", "0,07", "0,08", "0,09", "0,1", "0,12", "0,14", "0,15", "0,16", "0,17", "0,18", "0,19", "0,2", "0,21", "0,22", "0,23", "0,25", "0,26", "0,27", "0,29", "0,3", "0,36"), class = "factor"), Apr = structure(c(4L, 14L, 17L, 15L, 24L, 5L, 7L, 3L, 11L, 7L, 22L, 8L, 18L, 14L, 13L, 5L, 6L, 14L, 2L, 12L, 19L, 5L, 21L, 9L, 1L, 12L, 16L, 10L, 22L, 2L, 3L, 23L, 20L, 5L, 1L, 1L, 25L, 14L, 8L, 14L, 1L, 6L, 15L, 6L), .Label = c("-0,02", "-0,04", "-0,05", "-0,06", "-0,08", "-0,09", "-0,1", "-0,11", "-0,12", "-0,15", "-0,16", "-0,17", "-0,19", "-0,2", "-0,24", "-0,31", "-0,38", "0", "0,05", "0,06", "0,09", "0,12", "0,13", "0,16", "0,29"), class = "factor"), May = structure(c(10L, 18L, 16L, 20L, 5L, 3L, 13L, 10L, 24L, 4L, 6L, 9L, 28L, 7L, 6L, 1L, 23L, 3L, 25L, 15L, 11L, 12L, 22L, 10L, 27L, 17L, 14L, 2L, 26L, 29L, 28L, 6L, 20L, 21L, 19L, 8L, 27L, 7L, 1L, 3L, 30L, 9L, 4L, 24L), .Label = c("-0,01", "-0,03", "-0,04", "-0,06", "-0,07", "-0,09", "-0,1", "-0,11", "-0,12", "-0,15", "-0,16", "-0,17", "-0,24", "-0,27", "-0,29", "-0,3", "-0,39", "0", "0,01", "0,02", "0,04", "0,05", "0,06", "0,09", "0,1", "0,15", "0,19", "0,2", "0,27", "0,48"), class = "factor"), Jun = structure(c(26L, 24L, 25L, 20L, 11L, 10L, 8L, 18L, 23L, 19L, 13L, 29L, 26L, 10L, 16L, 5L, 27L, 12L, 21L, 3L, 22L, 6L, 20L, 5L, 20L, 13L, 15L, 28L, 4L, 18L, 18L, 17L, 30L, 14L, 22L, 25L, 15L, 7L, 2L, 19L, 9L, 11L, 24L, 1L), .Label = c("-0,01", "-0,07", "-0,08", "-0,11", "0", "0,01", "0,02", "0,05", "0,06", "0,07", "0,08", "0,1", "0,11", "0,12", "0,13", "0,14", "0,15", "0,16", "0,2", "0,21", "0,22", "0,23", "0,24", "0,25", "0,27", "0,3", "0,31", "0,34", "0,35", "0,41"), class = "factor"), Jul = structure(c(17L, 15L, 10L, 8L, 16L, 22L, 1L, 6L, 2L, 21L, 26L, 12L, 23L, 5L, 11L, 3L, 2L, 5L, 25L, 17L, 19L, 2L, 24L, 29L, 2L, 5L, 16L, 20L, 9L, 4L, 21L, 28L, 18L, 20L, 18L, 7L, 27L, 27L, 6L, 23L, 30L, 13L, 6L, 14L), .Label = c("-0,01", "-0,03", "-0,06", "-0,09", "-0,1", "-0,11", "-0,12", "-0,13", "-0,15", "-0,17", "-0,18", "-0,21", "-0,22", "-0,25", "0", "0,01", "0,02", "0,03", "0,04", "0,05", "0,06", "0,07", "0,1", "0,11", "0,13", "0,16", "0,2", "0,24", "0,27", "0,28"), class = "factor"), Aug = structure(c(1L, 20L, 8L, 6L, 16L, 19L, 29L, 23L, 21L, 6L, 16L, 13L, 22L, 24L, 25L, 15L, 17L, 30L, 28L, 16L, 14L, 5L, 19L, 26L, 27L, 18L, 1L, 3L, 12L, 7L, 4L, 1L, 15L, 16L, 18L, 18L, 2L, 11L, 9L, 1L, 17L, 1L, 31L, 10L), .Label = c("-0,01", "-0,02", "-0,03", "-0,04", "-0,05", "-0,06", "-0,07", "-0,1", "-0,15", "-0,18", "-0,2", "-0,29", "0", "0,01", "0,03", "0,04", "0,05", "0,06", "0,07", "0,08", "0,09", "0,1", "0,12", "0,13", "0,14", "0,17", "0,19", "0,2", "0,21", "0,23", "0,3"), class = "factor"), Sep = structure(c(24L, 11L, 17L, 19L, 1L, 7L, 1L, 10L, 9L, 4L, 28L, 27L, 11L, 12L, 13L, 7L, 1L, 5L, 14L, 3L, 21L, 8L, 2L, 1L, 16L, 11L, 1L, 20L, 22L, 23L, 6L, 6L, 24L, 1L, 18L, 21L, 16L, 6L, 24L, 13L, 25L, 15L, 6L, 26L), .Label = c("-0,01", "-0,03", "-0,05", "-0,06", "-0,07", "-0,1", "-0,12", "-0,14", "-0,16", "-0,2", "0", "0,01", "0,02", "0,08", "0,09", "0,1", "0,11", "0,17", "0,18", "0,22", "0,27", "0,34", "0,36", "0,37", "0,38", "0,39", "0,4", "0,46"), class = "factor"), Oct = structure(c(14L, 9L, 17L, 8L, 17L, 12L, 5L, 10L, 13L, 6L, 21L, 11L, 22L, 7L, 12L, 9L, 10L, 12L, 1L, 3L, 19L, 2L, 12L, 4L, 1L, 13L, 7L, 20L, 17L, 2L, 9L, 23L, 14L, 16L, 7L, 24L, 18L, 7L, 25L, 7L, 17L, 15L, 11L, 8L), .Label = c("-0,01", "-0,02", "-0,03", "-0,04", "-0,06", "-0,11", "0", "0,01", "0,02", "0,03", "0,04", "0,05", "0,06", "0,08", "0,09", "0,1", "0,11", "0,12", "0,13", "0,14", "0,16", "0,2", "0,21", "0,22", "0,39"), class = "factor"), Nov = structure(c(15L, 6L, 14L, 2L, 11L, 5L, 5L, 5L, 1L, 5L, 18L, 19L, 10L, 8L, 4L, 3L, 9L, 7L, 7L, 5L, 12L, 5L, 9L, 2L, 6L, 7L, 5L, 6L, 18L, 17L, 5L, 5L, 13L, 5L, 20L, 13L, 16L, 5L, 18L, 5L, 22L, 3L, 3L, 21L), .Label = c("-0,01", "-0,02", "-0,03", "-0,07", "0", "0,02", "0,03", "0,04", "0,09", "0,1", "0,11", "0,12", "0,13", "0,14", "0,15", "0,2", "0,23", "0,25", "0,26", "0,29", "0,3", "0,4"), class = "factor"), Dec = structure(c(16L, 4L, 2L, 10L, 15L, 7L, 5L, 3L, 2L, 10L, 16L, 11L, 12L, 4L, 2L, 2L, 13L, 5L, 9L, 2L, 9L, 6L, 10L, 1L, 13L, 5L, 3L, 8L, 11L, 14L, 10L, 12L, 16L, 8L, 12L, 18L, 15L, 9L, 17L, 7L, 18L, 4L, 3L, 13L), .Label = c("-0,01", "0", "0,01", "0,02", "0,03", "0,04", "0,05", "0,06", "0,07", "0,08", "0,09", "0,1", "0,11", "0,14", "0,15", "0,17", "0,2", "0,21"), class = "factor"), Lat = structure(c(8L, 5L, 4L, 2L, 37L, 40L, 36L, 39L, 13L, 38L, 32L, 1L, 26L, 14L, 21L, 33L, 23L, 19L, 27L, 10L, 12L, 41L, 35L, 44L, 24L, 6L, 9L, 17L, 42L, 22L, 30L, 43L, 29L, 15L, 20L, 7L, 34L, 31L, 11L, 28L, 25L, 3L, 18L, 16L), .Label = c("34", "34,1714", "34,1747", "34,221", "34,6", "34,61", "34,7253", "34,786", "34,8911", "34,9894", "35,054", "35,0567", "35,1756", "35,2", "35,4253", "35,4814", "35,505", "35,52", "35,585", "35,6239", "35,63", "35,7781", "35,816", "35,8583", "35,9369", "36", "36,0942", "36,1175", "36,122", "36,228", "36,3", "36,3225", "36,5914", "36,6692", "36,7222", "36,7236", "36,7683", "36,7747", "36,8", "36,813", "36,859", "36,88", "36,8914", "36,903"), class = "factor"), Long = structure(c(20L, 39L, 13L, 25L, 15L, 2L, 5L, 44L, 37L, 35L, 12L, 18L, 32L, 1L, 33L, 4L, 27L, 42L, 29L, 40L, 19L, 3L, 28L, 6L, 30L, 36L, 43L, 21L, 8L, 11L, 41L, 23L, 34L, 16L, 14L, 26L, 17L, 22L, 7L, 24L, 9L, 31L, 38L, 10L), .Label = c("-100", "-100,5", "-101,2", "-101,618", "-102,481", "-103", "-94,63", "-94,9", "-94,9644", "-95,2039", "-95,3339", "-95,5808", "-95,62", "-96,025", "-96,0261", "-96,303", "-96,3472", "-96,37", "-96,3861", "-96,69", "-96,98", "-97", "-97,059", "-97,095", "-97,129", "-97,2814", "-97,4", "-97,7903", "-97,835", "-97,9294", "-97,996", "-98", "-98,3", "-98,32", "-98,3583", "-98,46", "-98,579", "-98,6986", "-99", "-99,0525", "-99,17", "-99,3953", "-99,502", "-99,64"), class = "factor")), .Names = c("place", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "Lat", "Long"), class = "data.frame", row.names = c(NA, -44L))
After that reshape the dataframe:
require(reshape2)
stations <- melt(oklahoma, id=c("place","Lat","Long"))
stations$value <- gsub(',', '.', stations$value)
stations$value <- as.numeric(stations$value)
The create the plot:
ggplot() +
# geom_polygon(data=m, aes(x=Long, y=Lat,group=group), colour="black", fill="white") +
geom_point(data=stations, aes(x=Long,y=Lat), colour="red")+
xlab('Longitude') +
ylab('Latitude') +
coord_fixed() +
facet_wrap(~ variable, ncol = 3)
As you can see, I commented out the geom_polygon
as I don't have that data.