简体   繁体   English

在R中使用ggmap mapdist()

[英]Using ggmap mapdist() with R

I am trying to find distance between two points using ggmap in Tableau. 我正在尝试在Tableau中使用ggmap查找两点之间的距离。 I get an error that the result returned by the script is of an unknown type. 我收到一个错误,指出脚本返回的结果是未知类型。 I tried using SCRIPT_STR() but that does not work as well. 我尝试使用SCRIPT_STR(),但效果不佳。 Below is a sample test code I am trying to use. 以下是我尝试使用的示例测试代码。

SCRIPT_REAL("library('ggplot2');library('ggmap');mapdist('11040',.arg1)[5]",'10041')

It looks like you closed the mapdist() function before giving it the to argument (ie, the closing ')' following .arg1 ) 好像您在给它to参数(即.arg1的结束')'之前关闭了mapdist()函数。

In R, you would have: 在R中,您将具有:

library(ggmap)
mapdist('11040','10041')

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM