Display all values in the legend of a shapefile

Clash Royale CLAN TAG#URR8PPP
Display all values in the legend of a shapefile
Sample data:
library(raster)
fra <- getData("GADM", country = 'FRA', level = 1)
spplot(fra, "ID_1")

Since ID_1 are integers, I want to display all the values in the legend as well as label the polygon with ID_1.
ID_1
ID_1
1 Answer
1
spplot(fra, "ID_1",
colorkey = list(labels = list(at = fra@data$ID_1, labels = fra@data$NAME_1)))

D_1
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Hi. I do not want the names. I need the
D_1values displayed in the legend but I understood how to do it now. Thanks– Crop89
Aug 8 at 8:57