Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/69.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ruby-on-rails-3/4.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
为什么在使用模式为'draw'的mapedit::selectFeatures时出错?_R_Maps_R Mapview_R Mapedit - Fatal编程技术网

为什么在使用模式为'draw'的mapedit::selectFeatures时出错?

为什么在使用模式为'draw'的mapedit::selectFeatures时出错?,r,maps,r-mapview,r-mapedit,R,Maps,R Mapview,R Mapedit,我正在使用名为mapedit的R包中的selectFeatures函数。 我希望能够选择全部或部分位于使用mapedit viewer中的工具绘制的区域内的所有多边形 使用以下来自“单击”模式的代码可以工作。 但是,当我将模式更改为“绘制”,然后使用任何工具完成绘制时,会产生下面的错误,地图将从查看器中删除,并且在本例中,对象中未存储任何内容selected2 library(mapview) library(mapedit) library(sf) nc <- st_read(syst

我正在使用名为mapedit的R包中的selectFeatures函数。 我希望能够选择全部或部分位于使用mapedit viewer中的工具绘制的区域内的所有多边形

使用以下来自“单击”模式的代码可以工作。 但是,当我将模式更改为“绘制”,然后使用任何工具完成绘制时,会产生下面的错误,地图将从查看器中删除,并且在本例中,对象中未存储任何内容selected2

library(mapview)
library(mapedit)
library(sf)

nc <- st_read(system.file("shape/nc.shp", package="sf"))
selected <- selectFeatures(nc, mode = 'click')
selected2 <- selectFeatures(nc, mode = 'draw')
警告:st_read中出错。默认值:没有可用于json类对象的st_read方法

有我错过的一步吗


另外,如果有人拥有比我更高的权限,是否可以创建一个r-mapedit标记?

我可以通过从r v3.4.4更新到r v3.5.0来解决这个问题。

使用mapedit版本0.4.1,我无法重现您的错误。一切正常。嗨,蒂姆,奇怪。。。我使用的是相同版本的mapedit 0.4.1。你用什么版本的R进行测试?我使用Rv3.4.4是因为与特定软件包的兼容性问题。在WindowsWr3.5.0和UbuntuWr3.4.4上都进行了测试,没有任何问题。