Closed Robinlovelace closed 6 years ago
i think that's the non-latest version of dodgr
. Can you install latest and check again?
It is the latest version from ATFutures:
devtools::install_github("ATFutures/dodgr")
Skipping install of 'dodgr' from a github remote, the SHA1 (dc6d87a8) has not changed since last install.
Use `force = TRUE` to force installation
This is what is going into the spatial interaction model:
net
~1million rows with 12 colsdens
64 numbersnodes
char strings representing the 102 zonesokay, i'll check it out now. I've seen that error before, so i know that i know how to solve it.
Maybe it's a difference between our datasets? Try pushing the contents of who-data if it is
it's not that because i've reset / deleted my local who-data
. Am currently waiting while it re-clones
OK thanks. Great use of optimise()
in any case.
I'm reading the documentation for it now.
I've got a test case somewhere for 4 "modern" implementations of that versus base optimise
that clearly show the superiority of base R
in loads of standard conditions. optimise
seems truly optimised. It's so bloody fast and accurate!
Oh, it is a problem with outdated dodgr
, but i haven't changed the version number, so you'll have to uninstall then reinstall coz devtools
only checks version number. I just ran it from scratch with re-cloned who
and who-data
and all works perfectly.
Aha - I suggest updating the version number if that's the case. In my experience though devtools updates packages even when you don't change the version number as far as I know (AFAIK)
Or IIRC...
I'm just re-installing it. FYI it seemed to have updated it 1st time round though... could you print out a summary of what you have for dens
? I'm surprised it's only 64 elements.
Seems to be doing something...
Getting this error now:
Error in rcpp_spatial_interaction(graph2, vert_map, node_index, k, dens, :
object 'k' not found
But this works (result!):
dodgr_spatial_interaction (net, nodes, dens, k = k)
I think k just needs to be initiated...
Now getting a strange result (may be because tol was v high):
res <- optimise (f (k) , lower = 0.1, upper = 20, maximum = TRUE, tol = 0.1)
> res
$maximum
[1] 6.821563
OK - resolved. But I'm getting another error message:
f <- dodgr_flows(net, od_id, od_id, flows = s, contract = T)
Error in get_pts_index(graph, gr_cols, vert_map, pts) :
from/to are not numeric yet can not be matched onto graph vertices
From the same script... No biggy, does not stop me finishing the report.
https://github.com/ATFutures/who/blob/4db174b453175d4abe8f94f457c1ee5d17ba8992/code/od-calibrate.R#L66
All works until I get to this line. I get this error: