require(tmap) #for append_data
#' Merge data to an object of class SpatialPolygonsDataFrame
#'
#'@param map an object of class Shape(SpatialPolygonsDataFrame)
#'@param data a data.frame
#'@param code a name of variable of shp map data and data.frame to be matched with
#'
#'@return a Shape object with appended data
#'@export
mergeData2Map=function(map,data,code="code"){
map@data$code1=as.character(map@data[[code]])
data$code1=as.character(data[[code]])
result=append_data(map,data,key.shp="code1",key.data="code1")
result
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.