pol_aggregate: Aggregate cities of a sf object

Description Usage Arguments Value Examples

View source: R/pol_aggregate(tidyverse).R

Description

This function allows you to aggregate cities of a spatial dataframe from designed identifier

Usage

1
pol_aggregate(before, after, pol, idpol, namepol, nameAgr)

Arguments

before

A list of the identifiers to be replaced

after

A character string of the identifier replacement

pol

An sf object of the cities

idpol

A character string of the column containing the id of the pol object

namepol

A character string of the column containing the names of the pol object

nameAgr

A character string of the name to be changed for the aggregated city

Value

An sf object with a new id of aggregate city, and the polygons aggregated

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Import data
before <-  c(75101, 75102, 75103,75104, 75105,75106,75107, 75108, 75109,
             75110,75111, 75112, 75113, 75114,75115, 75116, 75117,75118, 75119, 75120)
after <- 75056
data(pol)
idpol <- "idpol"
namepol <- "name"
nameAgr <- "paris"

polAggregate <- pol_aggregate(before, after, pol, idpol, namepol, nameAgr)

plot(polAggregate)

Geographie-cites/toyspace documentation built on July 11, 2019, 6:07 p.m.