为什么在模式 = 'draw' 的情况下使用 mapedit::selectFeatures 时会出现错误?

Why do I get an error when using mapedit::selectFeatures with mode = 'draw'?

我正在使用名为 mapedit 的 R 包中的 selectFeatures 函数。 我希望能够 select 所有落入(全部或部分)使用 mapedit 查看器中的工具绘制的区域内的多边形。

使用 (mapedit doc) 中的以下代码,点击模式有效。 但是,当我将模式更改为绘图然后使用任何工具完成绘图时,它会产生以下错误并且地图从查看器中删除并且对象中没有存储任何内容(在本例中 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')

Warning: Error in st_read.default: no st_read method available for objects of class json

我是否遗漏了一个步骤?

另外,请比我有更高权限的人创建一个 r-mapedit 标签吗?

我能够通过从 R v3.4.4 更新到 R v3.5.0 来解决问题。