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