Learn R Programming

TDLM

Systematic comparison of trip distribution laws and models



1 Short description

The main purpose of the TDLM package is to provide a rigorous framework for fairly comparing trip distribution laws and models, as described in Lenormand et al. (2016). This general framework relies on a two-step approach to generate mobility flows, separating the trip distribution law, gravity or intervening opportunities, from the modeling approach used to derive flows from this law.

2 Install

The TDLM package can be installed with the following command in an R session:

From the CRAN

install.packages("TDLM")

or from GitHub

# install.packages("devtools")
devtools::install_github("EpiVec/TDLM", build_vignettes = TRUE)

3 Tutorial

A tutorial vignette is available here.

4 Dependencies

TDLM depends on the following packages: Ecume, mathjaxr, Rdpack, readr, rmarkdown, and sf.

Additionally, TDLM requires Java to function properly. Please ensure that Java is installed and correctly configured on your system.

5 Citation

Lenormand M (2023) TDLM: An R package for a systematic comparison of trip distribution laws and models. Journal of Open Source Software 8, 5434.

Please feel free to open an issue if you encounter a problem with the package.

Copy Link

Version

Install

install.packages('TDLM')

Monthly Downloads

371

Version

1.1.1

License

GPL-3

Maintainer

Maxime Lenormand

Last Published

March 6th, 2025

Functions in TDLM (1.1.1)

coords_xy

Geographical coordinates of US Kansas counties' centroids in 2000 (X/Y based on Web Mercator)
extract_spatial_information

Extract distances and surface areas from a spatial object
extract_distances

Compute the distance between pairs of locations
calib_param

Automatic calibration of trip distribution laws' parameter
check_format_names

Check format of TDLM's inputs
extract_opportunities

Compute the number of opportunities between pairs of locations
gof

Compute goodness-of-fit measures between observed and simulated OD matrices
run_law_model

Estimate mobility flows based on different trip distribution laws and models
run_model

Estimate mobility flows based on different trip distribution models
run_law

Estimate mobility flows based on different trip distribution laws
county

Spatial distribution of US Kansas counties in 2000
coords

Geographical coordinates of US Kansas counties' centroids in 2000 (Longitude/Latitude)
od

Origin-Destination commuting matrix between US Kansas counties in 2000
mass

Population and number of out- and in-commuters by US Kansas county in 2000
distance

Great-circle distances between US Kansas counties