Is there a way to have the plot legend categories in a specific order with a SpatVector map of package terra? Example:
library(terra)
v <- vect(system.file("ex/lux.shp", package="terra"))
head(v)
plot(v, "NAME_1")
How can we get "Luxembourg" to appear first in the legend, and also the remaining categories in a user-specified order? We've tried converting the "NAME_1" column to factor, but it's still interpreted as character.




