Description Usage Arguments Value Examples
Gov_function mapping data by state
1 2 3 | Gov_function(data, var, mapTitle = "", mapColor = NULL,
titleColor = "black", GOVcode, showVar1, showVar2, addLeg = T,
prov = providers$Esri.WorldImagery)
|
data |
a data set that contains at least your states and the variable to represent |
var |
a numeric that indicate the colum number that contains your variable |
mapTitle |
the map title |
mapColor |
the map color |
titleColor |
the color for the title |
GOVcode |
a numeric that indicate the colum number that contains the states code |
showVar1 |
: the variables you want to show in the highlight box on the map |
showVar2 |
: the variables you want to show in the highlight box on the map |
addLeg |
: a boolean to set to true in you want to have legend by the side of the map |
prov |
: it have to be in format : providers$... and the provider you want to have in the background you can see all the providers by typing View(providers) or going to https://leaflet-extras.github.io/leaflet-providers/preview/ where you can fin all the providers and how they look like |
a map with your data
1 2 3 4 | testG <- cbind(tnMAP$NAME_1,rnorm(n = 24,mean = 20,sd = 13),tnMAP$HASC_1)
testG=as.data.frame(testG)
testG[,2]=as.numeric(testG[,2])
Gov_function(data = testG,var=2,mapTitle= "new MAp ",titleColor = "red",mapColor =c("white","red"),GOVcode = 3,addLeg = T,prov = providers$OpenStreetMap,showVar1 = 1,showVar2 = 2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.