Display all values in the legend of a shapefile

The name of the pictureThe name of the pictureThe name of the pictureClash 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")



enter image description here



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)))



enter image description here





Hi. I do not want the names. I need the D_1 values displayed in the legend but I understood how to do it now. Thanks
– Crop89
Aug 8 at 8:57



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.

Popular posts from this blog

make 2 or more post in bootsrap

Store custom data using WC_Cart add_to_cart() method in Woocommerce 3

Firebase Auth - with Email and Password - Check user already registered