Learn R Programming

leafletCN (version 0.2.2)

read.geoShape: Read geoshape file into R

Description

Function for reading geojson shape file into R, come out to be a SpatialPolygonsDataFrame object

Usage

read.geoShape(txt)

Arguments

txt

a JSON string, URL or file

Examples

Run this code
# NOT RUN {
if(require(sp)){
  filePath = system.file("geojson/china.json",package = "leafletCN")
  map = read.geoShape(filePath)
  plot(map)
}
# }

Run the code above in your browser using DataLab