relocate_one: Create a dictionnary of id change

Description Usage Arguments Value Examples

View source: R/relocate_one.R

Description

This function is a low-level one and used in each *_city function (cbd_city, tod_city, finger_city ...etc.). this gives a dictionary which indicates by which new identifier the old one must be changed, the latter answering the criterion of proximity and to the candidacy of the city

Usage

1
relocate_one(pol, idpol, cand)

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

Value

A data.frame with two column : OLD (containing the id to be changed) and NEW (containing the new id)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# Import data
data(polL93)
idpol <- "idpol"
cand <- "cand"

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

dictioTransfer <- relocate_one(polL93, idpol, cand)

dictioTransfer[1:10,]

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