在 R 中绘制 shp 文件的 1 个属性

Plotting 1 attribute of a shp file in R

我正在尝试 select 绘制形状文件中这 9 个属性中的一个,但似乎没有任何效果。 你能帮忙吗?

enter image description here

如果您制作一个完全可重现的示例,那么修复者可以 运行 代码并确定他们已经解决了问题,这会有所帮助。

这是一个示例,您必须根据自己的需要进行修改。

library(sf)
fname <- system.file("shape/nc.shp", package="sf") # read a shape file that comes with the sf package
nc <- st_read(fname)
plot(nc)  # plot all the data

plot(nc['AREA']) # plot one of the attributes