od_aggregate | R Documentation |
This function is for aggregating OD pairs. It generally decreases the number of rows in an OD dataset, while aiming to keep the amount of travel represented in the data the same.
od_aggregate(od, aggzones = NULL, FUN = sum)
od_group(od, aggzones = NULL, FUN = sum)
od |
An origin-destination data frame |
aggzones |
Points within the zones defining the OD data |
FUN |
The aggregating function to use |
An alias for the function is od_group()
.
od_aggregated = od_data_df[1:2, c(1, 2, 9)]
aggzones = od::od_data_zones_min
subzones = od_data_zones_small
plot(aggzones$geometry)
plot(subzones$geometry, add = TRUE)
od = od_disaggregate(od_aggregated, aggzones, subzones)
od_agg = od_aggregate(od, aggzones)
names(od_agg)[1:(ncol(od_agg) - 1)] = names(od_aggregated)
attr(od_aggregated, "spec") = NULL
identical(sf::st_drop_geometry(od_agg), od_aggregated)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.