Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Row sums do not add up to totals #31

Open
Robinlovelace opened this issue Apr 30, 2021 · 0 comments
Open

Row sums do not add up to totals #31

Robinlovelace opened this issue Apr 30, 2021 · 0 comments
Assignees

Comments

@Robinlovelace
Copy link
Member

library(od)
od = od_data_df[1:2, ]
zones = od::od_data_zones_min
subzones = od_data_zones_small
od_disag = od_disaggregate(od, zones, subzones)
#> Converting subzones to centroids
#> although coordinates are longitude/latitude, st_intersects assumes that they are planar
#> although coordinates are longitude/latitude, st_intersects assumes that they are planar
#> although coordinates are longitude/latitude, st_intersects assumes that they are planar
#> although coordinates are longitude/latitude, st_intersects assumes that they are planar
ncol(od_disag) -1 == ncol(od) # same number of columns (except disag data gained geometry)
#> [1] FALSE
sum(od_disag[[3]]) == sum(od[[3]])
#> [1] TRUE
sum(od_disag[[4]]) == sum(od[[4]])
#> [1] TRUE
plot(rowSums(sf::st_drop_geometry(od_disag)[4:10]), od_disag[[3]])

Created on 2021-04-30 by the reprex package (v2.0.0)

Robinlovelace added a commit that referenced this issue Apr 30, 2021
@Robinlovelace Robinlovelace self-assigned this May 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant