R 使用gmapsdistance的Google距离矩阵API的随机错误
我有一个起点/终点对表(纬度坐标)。我正在使用R库R 使用gmapsdistance的Google距离矩阵API的随机错误,r,google-maps,google-distancematrix-api,R,Google Maps,Google Distancematrix Api,我有一个起点/终点对表(纬度坐标)。我正在使用R库gmapsdestance和mapply在表上循环,为每一行调用API。(这种方法的主要原因是每一行都是出发地、目的地和出发时间的唯一组合,但gmapsdestance不接受出发时间向量。) 问题是我得到的是随机的、不可再现的错误。我将运行前2000行,有些东西将崩溃。我将备份并运行第一个1000,然后运行第二个1000,不会出现错误 因此,我无法提供一个可复制的示例。(如果可以的话,我想我现在已经解决了这个问题。)以下是我的mapply电话:
gmapsdestance
和mapply
在表上循环,为每一行调用API。(这种方法的主要原因是每一行都是出发地、目的地和出发时间的唯一组合,但gmapsdestance
不接受出发时间向量。)
问题是我得到的是随机的、不可再现的错误。我将运行前2000行,有些东西将崩溃。我将备份并运行第一个1000,然后运行第二个1000,不会出现错误
因此,我无法提供一个可复制的示例。(如果可以的话,我想我现在已经解决了这个问题。)以下是我的mapply电话:
result <- mapply(
gmapsdistance,
origin = to_skim$coords_orig,
destination = to_skim$coords_dest,
combinations = "pairwise",
key = api_key,
mode = mode,
departure = to_skim$departure_secs
)
关键是我可以重新运行完全相同的调用并获得成功的结果。谢谢你的建议
AttValue: " or ' expected
attributes construct error
Couldn't find end of Start Tag html line 2
Extra content at the end of the document