I have a data set in R.
Sample dataset
location longitude latitude
loc1 24.600 67.524
loc1 24.600 67.535
loc2 28.478 -17.789
loc3 30.654 12.397
loc3 30.654 12.397
loc3 30.654 12.397
This is the code I've been trying with.
library(ggplot2)
data <- read.csv('a.csv')
ggplot(data, aes(year, value, group = 1)) + geom_line(aes(color = coalgrade)) + labs(x = "year", y = "value") + facet_wrap(~location + coalgrade)
How can I arrange the facets to be in order based on longitude?