Learn R Programming

MCI2 (version 1.1.2)

to.tcmat: Creation of a transport costs matrix

Description

Creation of a tcmat list object from a given transport costs table

Usage

to.tcmat(dataset, colname.from, colname.to, colname.tc)

Arguments

dataset

A data frame containing the transport costs table

colname.from

Name of the column containing the origin IDs

colname.to

Name of the column containing the destination IDs

colname.tc

Name of the column containing the transport costs (e.g. airline distances, travel times)

Value

A tcmat list (invisible) containing the following components:

coords_origins

A data.frame

coords_destinations

A data.frame

tcmat

A data.frame containing the transport costs matrix

tc.mode

A list containing information about the transportation costs matrix

Details

Creation of a tcmat list object (Transport costs matrix) from a given table for further use in huff and mcimat.create.

See Also

huff, mcimat.create, tcmat.create

Examples

Run this code
# NOT RUN {
data(Haslach_tcmatDrvtime)
# Travel times from the Haslach example
Haslach_tcmat <- to.tcmat (Haslach_tcmatDrvtime, "from", "to", "tc")
# Creating new tcmat object
Haslach_tcmat
# }

Run the code above in your browser using DataLab