Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 使用gmapsdistance的Google距离矩阵API的随机错误_R_Google Maps_Google Distancematrix Api - Fatal编程技术网

R 使用gmapsdistance的Google距离矩阵API的随机错误

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电话:

我有一个起点/终点对表(纬度坐标)。我正在使用R库
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