First question to the group- I hope it has an easy answer: I have noticed odd behavior in ggplot with facets. My dataset contians longitude, latitude and a zipcode for schools over 16 years. I have noticed that the sort order of the data sets produces different plots, and I can't find documentation supporting this.
For example, this produces a map I don't believe:
SchoolDiscipline <- SchoolDiscipline[with(SchoolDiscipline, order(zip, YEAR)), ]
mo_base +
geom_point(aes(x = SchoolDiscipline$long, y = SchoolDiscipline$lat),
data = SchoolDiscipline,
alpha = .50, inherit.aes = FALSE) +
facet_wrap(~YEAR, ncol = 4)
while this produces a map I do believe:
SchoolDiscipline <- SchoolDiscipline[with(SchoolDiscipline, order(YEAR, zip)), ]
mo_base+
geom_point(aes(x = SchoolDiscipline$long, y = SchoolDiscipline$lat),
data = SchoolDiscipline,
alpha = .50, inherit.aes = FALSE) +
facet_wrap(~YEAR, ncol=4)
Can anyone explain this behavior? many thanks!