Learn R Programming

sp (version 2.1-2)

sp2Mondrian: write map data for Mondrian

Description

The function outputs a SpatialPolygonsDataFrame object to be used by Mondrian

Usage

sp2Mondrian(SP, file, new_format=TRUE)

Arguments

SP

a SpatialPolygonsDataFrame object

file

file where output is written

new_format

default TRUE, creates a text data file and a separate map file; the old format put both data sets in a single file - the map file is named by inserting "MAP_" into the file= argument after the rightmost directory separator (if any)

Author

Patrick Hausmann and Roger Bivand

References

https://www.theusrus.de/Mondrian/, Ihaka Lecture 1: 28 September 2023, Interactive Graphics and Data Analysis, Antony Unwin https://www.auckland.ac.nz/en/science/about-the-faculty/department-of-statistics/ihaka-lecture-series.html

Examples

Run this code
if (require("sf", quietly=TRUE)) {
td <- tempdir()
xx <- as(sf::st_read(system.file("shape/nc.shp", package="sf")[1], quiet=TRUE), "Spatial")
sp2Mondrian(xx, file=file.path(td, "sids1.txt"))
}

Run the code above in your browser using DataLab