choropleth_sf: Create choropleth simple feature object from points

Description Usage Arguments Value Author(s) Examples

View source: R/nlchoropleth.R

Description

Create choropleth simple feature object from points.

Usage

1
choropleth_sf(sf_map, df, oper, crs = 4326)

Arguments

sf_map

Simple features object. Note that shapefiles consist of more than one file, all with identical basename, which should reside in the same directory.

df

Data.frame of interest. The data.frame should contain the column names 'lon' and 'lat'

oper

An operation on the polygon level.

crs

Coordinate reference system: integer with the EPSG code, or character with proj4string

Value

standard feature object

Author(s)

Martin Haringa

Examples

1
2
3
4
5
6
choropleth_sf(nl_postcode2, insurance, sum(amount, na.rm = TRUE))
## Not run: 
shp_read <- sf::st_read(~/path/to/file.shp)
choropleth_sf(shp_read, insurance, sum(amount, na.rm = TRUE))

## End(Not run)

MHaringa/nlmaps documentation built on May 19, 2019, 9:40 p.m.