I currently have a UK shapefile, and I am referring to a population of species in different regions of the UK. So far, I just made up 3 levels of the species population and colored them red = high, orange = honey, green = low. But what I would like to do would be to have a gradient graph instead of being limited to only 3 colors. So far I have a table called โGraphโ that has regions as column names, and then the number of views for each region is lower. My lowest score is 0, and my highest score is around 2500, and the regions in Count are the same as the regions in my shapefile. I have a function that determines what is high, medium, low based on the levels you enter yourself.
High<-colnames(Count)[which(Count>'input value here')]
and then they are superimposed on the shapefile as follows:
plot(ukmap[(ukmap$Region %in% High),],col='red',add=T)
Unfortunately, I cannot install any packages, I thought about using colorRamp, but I'm not sure what to do?
EDIT: my data looks something like this.
Wales Midlands North Scotland South East South West 1 551 32 124 1 49 28 3 23 99 291 152 164 107 4 1 7 17 11 21 14 7 192 32 12 0 1 9 9 98 97 5 1 21 0
and the first column is just a number representing the view, and currently I have a function that calculates the score for the British shapefile, but is based on the borders of high, medium and low. The above data is not tied to my shapefile. Then I scroll through each row (view) of my dataset and draw a new map for each row (view).
source share