polycentric_city: DF transform to polycentric urban model

Description Usage Arguments Value Examples

View source: R/polycentric_city.R

Description

This function allows you to change the origins and destination of flows stored into a dataframe to simulate a polycentric urban model. Cities considered as employment pole and containing railroad station are designed as candidate and flows (destinations only) are moved from non-candidate cities to the nearest candidate cities (using osm network)

Usage

1
polycentric_city(pol, idpol, cand, tabflows, idori, iddes, idflow)

Arguments

pol

An sf object of the cities

idpol

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

cand

A character string of the column containing binary (1, 0) candidate value of the pol object (1 must be equal to city considered as employment pole and containing a railroad station)

tabflows

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

idori

A char

iddes

A character string giving the destination field name in tabflows

idflow

A character string giving the flow field name in tabflows

Value

A data.frame of flows as tabflows with origins and destinations changed

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# Import data

idpol <- "idpol"
cand <- "cand"
data(polL93)
data(tabflows)
iddes <- "DES"
idflow <- "FLOW"

polL93$cand <- sample(0:1, size = nrow(polL93), replace = TRUE)

poly_flows <- polycentric_city (
pol = polL93,
idpol = idpol,
cand = cand,
tabflows = tabflows,
iddes = iddes,
idflow = idflow)

poly_flows[1:10,]

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