Consider this plot, which shows values ranging from 0.042 to 0.241:
library(sf)
demo(nc, ask=FALSE, echo=FALSE)
brks <- seq(0, 0.2, by=0.05)
plot(nc["AREA"], key.pos=1, breaks=brks, at=brks)
However, let's say I need to customize the color key labels. I want add one "segment" to it in order to include values higher than 0.2.
For example:
brks2 <- c(seq(0, 0.2, by=0.05), 1)
plot(nc["AREA"], key.pos=1, breaks = brks2, at=brks2)
but the color key, rather than getting "stretched" from 0.2 to 1, should have just one more segment, with the label >0.2 or similar.
How can I do that?


