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

error in weight_streetnet.sc #145

Closed
dcooley opened this issue Oct 22, 2020 · 4 comments
Closed

error in weight_streetnet.sc #145

dcooley opened this issue Oct 22, 2020 · 4 comments

Comments

@dcooley
Copy link

dcooley commented Oct 22, 2020

I've tried this with the CRAN and github versions and get the same error when trying to weight an sc streetnet

remotes::install_github("ATFutures/dodgr")
library(dodgr)

bb <- structure(c(144.87514095, -37.87028083, 144.90975222, -37.84376583
), .Dim = c(2L, 2L), .Dimnames = list(c("x", "y"), c("min", "max"
)))

sc_streetnet <- dodgr::dodgr_streetnet_sc( bb )
wt <- dodgr::weight_streetnet( sc_streetnet, wt_profile = "motorcar")

# Error in cbind(as.numeric(obj[, xy_cols[1]]), as.numeric(obj[, xy_cols[2]])) : 
#   'list' object cannot be coerced to type 'double'

Session Info

devtools::session_info("dodgr")
# ─ Session info ────────────────────────────────────────────────────────────────────────────────────────────────────
# setting  value                       
# version  R version 4.0.2 (2020-06-22)
# os       macOS Catalina 10.15.6      
# system   x86_64, darwin17.0          
# ui       RStudio                     
# language (EN)                        
# collate  en_AU.UTF-8                 
# ctype    en_AU.UTF-8                 
# tz       Australia/Melbourne         
# date     2020-10-22                  
# 
# ─ Packages ────────────────────────────────────────────────────────────────────────────────────────────────────────
# package      * version    date       lib source                          
# askpass        1.1        2019-01-13 [1] CRAN (R 4.0.0)                  
# assertthat     0.2.1      2019-03-21 [1] CRAN (R 4.0.0)                  
# callr          3.5.1      2020-10-13 [1] CRAN (R 4.0.2)                  
# cli            2.1.0      2020-10-12 [1] CRAN (R 4.0.2)                  
# crayon         1.3.4.9000 2020-08-21 [1] Github (r-lib/crayon@6b3f0c6)   
# curl           4.3        2019-12-02 [1] CRAN (R 4.0.0)                  
# digest         0.6.26     2020-10-17 [1] CRAN (R 4.0.2)                  
# dodgr        * 0.2.7.017  2020-10-22 [1] Github (ATFutures/dodgr@f59b049)
# ellipsis       0.3.1      2020-05-15 [1] CRAN (R 4.0.0)                  
# fansi          0.4.1      2020-01-08 [1] CRAN (R 4.0.0)                  
# generics       0.0.2      2018-11-29 [1] CRAN (R 4.0.0)                  
# glue           1.4.2      2020-08-27 [1] CRAN (R 4.0.2)                  
# httr           1.4.2      2020-07-20 [1] CRAN (R 4.0.2)                  
# jsonlite       1.7.1      2020-09-07 [1] CRAN (R 4.0.2)                  
# lattice        0.20-41    2020-04-02 [1] CRAN (R 4.0.2)                  
# lifecycle      0.2.0      2020-03-06 [1] CRAN (R 4.0.0)                  
# lubridate      1.7.9      2020-06-08 [1] CRAN (R 4.0.2)                  
# magrittr       1.5        2014-11-22 [1] CRAN (R 4.0.0)                  
# mime           0.9        2020-02-04 [1] CRAN (R 4.0.0)                  
# openssl        1.4.3      2020-09-18 [1] CRAN (R 4.0.2)                  
# osmdata        0.1.3      2020-02-09 [1] CRAN (R 4.0.2)                  
# pillar         1.4.6      2020-07-10 [1] CRAN (R 4.0.2)                  
# pkgconfig      2.0.3      2019-09-22 [1] CRAN (R 4.0.0)                  
# processx       3.4.4      2020-09-03 [1] CRAN (R 4.0.2)                  
# ps             1.4.0      2020-10-07 [1] CRAN (R 4.0.2)                  
# R6             2.4.1      2019-11-12 [1] CRAN (R 4.0.0)                  
# Rcpp           1.0.5      2020-07-06 [1] CRAN (R 4.0.0)                  
# RcppParallel   5.0.2      2020-06-24 [1] CRAN (R 4.0.2)                  
# RcppThread     0.5.4      2019-10-19 [1] CRAN (R 4.0.2)                  
# rlang          0.4.8      2020-10-08 [1] CRAN (R 4.0.2)                  
# rvest          0.3.6      2020-07-25 [1] CRAN (R 4.0.2)                  
# selectr        0.4-2      2019-11-20 [1] CRAN (R 4.0.0)                  
# sp             1.4-4      2020-10-07 [1] CRAN (R 4.0.2)                  
# stringi        1.5.3      2020-09-09 [1] CRAN (R 4.0.2)                  
# stringr        1.4.0      2019-02-10 [1] CRAN (R 4.0.0)                  
# sys            3.4        2020-07-23 [1] CRAN (R 4.0.2)                  
# tibble         3.0.4      2020-10-12 [1] CRAN (R 4.0.2)                  
# utf8           1.1.4      2018-05-24 [1] CRAN (R 4.0.0)                  
# vctrs          0.3.4      2020-08-29 [1] CRAN (R 4.0.2)                  
# xml2           1.3.2      2020-04-23 [1] CRAN (R 4.0.0)   
@mpadge mpadge closed this as completed in a99593f Oct 22, 2020
@mpadge
Copy link
Member

mpadge commented Oct 22, 2020

Thanks Dave, that was actually a stuff up with my latest geodist update. I'll go back over there and fix, but in the meantime the above commit fixes the problem at this end.

Other topics while we're here: great work with your twin cities analyses - @noamross is doing very similar stuff for NY state, disaggregating census data onto building addresses. I told him about your work, so you may hear from him.

@dcooley
Copy link
Author

dcooley commented Oct 22, 2020

ah cool. Look forward to seeing what he's doing.
You may also have been able to recognise {dodgr} being used in the background. As we type I'm now building an interactive version where the user can change road-types on-the-fly, which is what lead me to this bug.

@mpadge
Copy link
Member

mpadge commented Oct 22, 2020

Cool! I was wondering whether there was some dodgr-izing going on behind the scenes there. So was each layer of the animation then a separate dodgr analysis? You might also be interested in upcoming #144, with which you'll be able to extract proportions of each trip that go along some particular category of way, and so do things like ascribe to each point a value proportional to the relative length of bicycle-borne journeys originating from that point (and maybe going to defined destinations, or wherever) which they have to spend travelling right next to cars. Those proportions will come out as an additional matrix alongside the current distance matrix, yet be calculated with almost the same computational efficiency.

@dcooley
Copy link
Author

dcooley commented Oct 22, 2020

Yes! #144 sounds almost exactly like what I'm putting together. Specifically, this shiny I'm building will show cycling vs driving to schools, and calculates various stats, including 'time spend on same road as a car'. It's very much a prototype and there's definite room for improvement, so I'll keep an eye out for the developments over here.

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

2 participants