Gov_function: Gov_function mapping data by state

Description Usage Arguments Value Examples

View source: R/Gov_function.R

Description

Gov_function mapping data by state

Usage

1
2
3
Gov_function(data, var, mapTitle = "", mapColor = NULL,
  titleColor = "black", GOVcode, showVar1, showVar2, addLeg = T,
  prov = providers$Esri.WorldImagery)

Arguments

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

Value

a map with your data

Examples

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)

AbbassiNarjes/DETmapTun documentation built on May 24, 2019, 12:34 a.m.