0

我正在尝试创建一张地图,显示一个物种在两个不同时间点之间的丰度变化。丰度变化已在 df Ggaleusmap 中以变量名称“dCPUE”计算 - 它包含表示特定坐标处丰度变化的正值和负值。我希望点的颜色显示丰度的增加和减少(红色表示增加,蓝色表示减少)。

数据集中 dCPUE 变量列的片段

我已将其定义为.numeric,以下代码是我收到错误时使用的代码:

basemap(limits = c(-12, 14, 36, 62), bathymetry = TRUE, bathy.style = "contour_blues", land.col = "#607D3B", land.border.col = NA) + geom_spatial_point(data=Ggaleusmap, aes(x=lon, y=lat, colour=dCPUE)) + scale_colour_gradient2 (high="red", mid="white", low="blue",  midpoint = 0)

我得到的确切错误是:

Using lon and lat as longitude and latitude columns, respectively.
projection transformed from +init=epsg:4326 to +init=epsg:3995
Scale for 'colour' is already present. Adding another scale for 'colour', which will replace the existing scale.
Assuming `crs = 4326` in stat_spatial_identity()
Error: Discrete value supplied to continuous scale
In addition: Warning message:
In sp::proj4string(shapefiles$land) :
  CRS object has comment, which is lost in output

只是为了帮助可视化我想要实现的目标,这张图片上有一些点,但它们没有使用变量“dCPUE”着色。 没有颜色渐变的绘图

这个图像几乎是我想要创建的,只是使用点而不是 类似于我想要创建的情节

有谁知道我怎么能做到这一点 - 如何克服这个错误?

4

0 回答 0