传单中的R-错误“ cut.default(x,binsToUse,标签= FALSE,include.lowest = TRUE,:'breaks'不是唯一的'错误”

时间:2018-09-27 13:20:42

标签: r leaflet shapefile

我正在使用在Rstudio.github上找到的代码,并且代码如下

[id]: value

那很好。但是,当我使用以下仅选择一个州来添加多边形层的以下内容时,例如,加利福尼亚州。我收到此错误“ cut.default(x,binsToUse,标签= FALSE,include.lowest = TRUE,:'breaks'不是唯一的”错误

代码是:

library(rgdal)

# From https://www.census.gov/geo/maps-data/data/cbf/cbf_state.html
states <- readOGR("shp/cb_2013_us_state_20m.shp",
  layer = "cb_2013_us_state_20m", GDAL1_integer64_policy = TRUE)
neStates <- subset(states, states$STUSPS %in% c(
  "CT","ME","MA","NH","RI","VT","NY","NJ","PA"
))

leaflet(neStates) %>%
  addPolygons(color = "#444444", weight = 1, smoothFactor = 0.5,
    opacity = 1.0, fillOpacity = 0.5,
    fillColor = ~colorQuantile("YlOrRd", ALAND)(ALAND),
    highlightOptions = highlightOptions(color = "white", weight = 2,
      bringToFront = TRUE))

有人知道为什么以及如何解决这个问题吗? 谢谢,我真的很感谢任何建议!

0 个答案:

没有答案