R/regionNames.R

Defines functions regionNames

Documented in regionNames

##' @title Show regions in submaps
##'
##' @description show regions in the map
##'
##' @usage
##' regionNames(mapName)
##'
##' @param mapName for loading, eg. 'china', 'city', ...
##'
##' @examples
##' regionNames('city')
##' @export

regionNames = function(mapName=NULL){
  # city = 'china'
  if(is.null(mapName)){
    print(mapNames$name)
    cat("\nThese are valid mapName~\n")
    return("NULL")
  }

  ## read from local files
  countries <- readGeoLocal(mapName)

  ## convert Encoding in Windows
  if(.Platform$OS.type == "windows"){
    encodingSolution(countries$name)
  }

  countries$name
}

Try the leafletCN package in your browser

Any scripts or data that you put into this service are public.

leafletCN documentation built on May 1, 2019, 9:21 p.m.