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

Only mode "driving" works. transit / walking / bicycling have replacement error. #53

Open
vince-p opened this issue Apr 12, 2019 · 1 comment

Comments

@vince-p
Copy link

vince-p commented Apr 12, 2019

Editing this to describe the error better:

When i set the mode to "driving" the gmapsdistance function works fine, but setting any other mode results in an error.

Here is the code I am running:
gmapsdistance( key=<MYKEY>, origin= "St+Peters,+NSW", destination = "Glebe,+NSW", mode="driving", shape = "wide", avoid = "", departure = 1557086400, traffic_model = "pessimistic" )

That works perfectly fine.
But when I change the mode to "transit" or "walking" or "bicycling" then I get the following error:

Error in data$Time[i] <- as(rowXML[[duration_key]][1L]$value[1L]$text, : replacement has length zero

@vince-p vince-p changed the title Setting mode to "transit" results in error Only mode "driving" works. transit / walking / bicycling have replacement error. Apr 14, 2019
@jlacko
Copy link

jlacko commented Apr 27, 2022

this issue has been resolved in issue 4.0.0 on CRAN since 2022-04-26

the root cause was that the traffic model is a recognized parameter of Google API call only for mode driving / see https://developers.google.com/maps/documentation/distance-matrix/distance-matrix?hl=en#traffic_model

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