city_aggregate: Aggregate cities of a DF

Description Usage Arguments Value Examples

View source: R/city_aggregate.R

Description

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

Usage

1
city_aggregate(before, after, tabflows, idori, iddes)

Arguments

before

A list of the identifiers to be replaced as numeric

after

A number of the identifier replacement

tabflows

A data.frame of flows between origins and destinations (long format matrix containing, at least, origins, destinations, flows)

idori

A character string giving the origin field name in tabflows (numeric)

iddes

A character string giving the destination field name in tabflows (numeric)

Value

A data.frame with the same variables as the shape, centroïds (lat,lon) and no geometries

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# 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(tabflows)
idori <- "ORI"
iddes <- "DES"

cityAggregate <- city_aggregate(before, after, tabflows, idori, iddes)

cityAggregate[1:10,]

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