دنبال کننده ها

۱۳۹۷ فروردین ۶, دوشنبه

google distancematrix api - How to input multiple departure dates and times in gmapsdistance R package?

[ad_1]



I am using the R package, gmapsdistance, to extract Google distance matrix.



My codes are:



gdm <- gmapsdistance(origin = origin_vector,
destination = destination_vector,
combinations = "pairwise",
mode = "driving",
shape = "long",
dep_date = date_vector,
dep_time = time_vector)


The Google API key was also set. The code works until the parameters for dep_date and dep_time. I believe it is because the parameters do not accept vectors. Two errors appear:
1: XML declaration allowed only at the start of the document.
2: Extra content at the end of the document.



In my dataset, each row is a data point with a unique origin, destination, departure date, and departure time. I require the Google distance/time for each row and there are thousands of them. There is no need for me to compare across rows. How may I do this?



Appreciate any help!




[ad_2]

لینک منبع