Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

od_aggregate_to

Summary statistics of trips arriving at destination zones in OD data


Description

This function takes a data frame of OD data and returns a data frame reporting summary statistics for each unique zone of destination.

Usage

od_aggregate_to(flow, attrib = NULL, FUN = sum, ..., col = 2)

Arguments

flow

A data frame representing origin-destination data. The first two columns of this data frame should correspond to the first column of the data in the zones. Thus in cents(), the first column is geo_code. This corresponds to the first two columns of flow().

attrib

character, column names in sl to be aggregated

FUN

A function to summarise OD data by

...

Additional arguments passed to FUN

col

The column that the OD dataset is grouped by (1 by default, the first column usually represents the origin)

Details

It has some default settings: it assumes the destination ID column is the 2nd and the default summary statistic is sum(). By default, if attrib is not set, it summarises all numeric columns.

See Also

Examples

od_aggregate_to(flow)

stplanr

Sustainable Transport Planning

v0.8.2
MIT + file LICENSE
Authors
Robin Lovelace [aut, cre] (<https://orcid.org/0000-0001-5679-6536>), Richard Ellison [aut], Malcolm Morgan [aut] (<https://orcid.org/0000-0002-9488-9183>), Barry Rowlingson [ctb], Nick Bearman [ctb], Nikolai Berkoff [ctb], Scott Chamberlain [rev] (Scott reviewed the package for rOpenSci, see https://github.com/ropensci/onboarding/issues/10), Mark Padgham [ctb], Andrea Gilardi [ctb] (<https://orcid.org/0000-0002-9424-7439>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.