#' Read DIVA GIS country boundaries and converts it so that there is only one
#' feature per country and has an ISO3 name.
#'
#' Reads DIVA GIS country boundaries as polygons from disk.
#'
#'
#' @usage readDivaGis()
#' @return Country polygons with ISO3 names
#' @author Ulrich Kreidenweis
#' @examples
#'
#' \dontrun{readDivaGis()}
#'
#' @export readDivaGis
#' @importFrom rgdal readOGR
readDivaGis <- function() {
boundaries <- readOGR("DIVA GIS/countries_shp/countries.shp", layer="countries")
ISO3 <- as.character(boundaries$ISO3)
# there are several polygons some countries, these are dissolved to multipolygons
boundariesU <- maptools::unionSpatialPolygons(boundaries, ISO3)
return(boundariesU)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.