correlateregions: Correlate the regions in a location dataframe with a list of...

View source: R/movement.R

correlateregionsR Documentation

Correlate the regions in a location dataframe with a list of regions which map to an observed movement dataset.

Description

A utility function that creates a list containing a location dataframe and a movement matrix. The regionlist and movementdata should be from the same source, i.e. the IDs in the movementdata correspond to the IDs in the regionlist. The data location is likely to be an external datasource, and the locations may not precisely match those in the regionlist. This function removes items from location which don't exist in regionlist and vice-versa. It then converts movementdata to a movement matrix with named rows and columns (based on regionlist).

Usage

correlateregions(location, regionlist, movementdata)

Arguments

location

A data.frame containing "name", "location", "pop", "lon" and "lat".

regionlist

A data.frame containing "name" and "id"

movementdata

A data.frame containing "origin", "destination", "movement"

Value

A list containing a locations data.frame with "name", "lat", "lon" and "pop" fields, and a observed matrix containing a movement matrix.


SEEG-Oxford/movement documentation built on April 17, 2023, 4:17 p.m.