Description Usage Arguments Value Examples
This function is to generate the color gradient with the customed levels
1 | colorGrinf(x, levels=NA, colors=c("green","yellow","red"), colsteps=10)
|
x |
A vector value |
levels |
levels of gradient colors |
colors |
Color ranges |
colsteps |
Levels of color gradient. |
levels |
Level of values for legend use |
cols |
Color ranges for legeng use |
index |
Color values for map. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | #Example
x=sample(c(1:1000),size=100)
x=x[order(x)]
ret=colorGrinf(x)
# A block Kriging example :
data("spointspre","countylayer")
tarF="d91" # target variable to be kriged
regionName="NAME_3"
bkRes=sptemExp::getTidBKMean(spointspre,countylayer,regionName,tarF,2)
bkRes=bkRes[!is.na(bkRes$bkm_fill),]
levels=c(30,60,100,150,250)
cr=sptemExp::colorGrinf(bkRes$bkm_fill,levels,colors=c("darkgreen","yellow","darkred"))
par(mar=c(1,1,1,1))
title=expression("Regional Block Kriged PM"[2.5]*" Concentration Estimated")
raster::plot(bkRes,col =cr$cols[cr$index],main=title)
legend("bottomright", fill =cr$cols, legend = cr$levels,col =cr$cols, cex=1,bty="n",bg="n")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.