Description Usage Arguments Value References
toTopoJSON
takes one or several
SpatialPolygonsDataFrame
objects and creates a
topojson file, multi-layered if needed. This functions
needs the topojson
CLI utility to be installed (see
https://github.com/mbostock/topojson/wiki/Installation).
1 2 3 |
SPDF |
a named list of
|
path |
the path where the topojson file should be registered. By default, the working directory. |
filename |
the name of the topojson file, without extension. By default, the name of the first SPDF object. |
simplification |
the geometry simplification factor. A numeric between 0 and 1, 0 being the maximum simplification, 1 retaining all the subtleties of the geometries. See https://github.com/mbostock/topojson/wiki/Command-Line-Reference for more details. |
quantisation |
maximum number of differentiable points along either dimension. |
width |
width of the desired output (in pixels) |
height |
height of the desired output (in pixels) |
properties |
the names of the properties of the SPDFs to be exported to the topojson file. A vector of character strings. If NULL (the default), all columns of the SPDFs dataframes. If "", no properties are included in the TopoJSON file. |
id |
the name of the SPDF column used as ID. By default, no ID. |
Nothing. As a side effect, a topojson file is created.
Mike Bostock's wiki: https://github.com/mbostock/topojson/wiki.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.