tod_city: DF transform to TOD urban model

Description Usage Arguments Value Examples

View source: R/tod_city.R

Description

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

Usage

1
tod_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 character string giving the origin field name in tabflows

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
21
22
# Import data

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

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

tod_flows <- tod_city (
pol = polL93,
idpol = idpol,
cand = cand,
tabflows = tabflows,
idori = idori,
iddes = iddes,
idflow = idflow)

tod_flows[1:10,]

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