我正在尝试在 R 中为入侵牡蛎物种(海洋)做物种分布图。使用我正在使用的代码,它只会在陆地 ( ext= geographic.extent
) 上绘制点。例如,我找不到其他“范围”选项marine.extent
或一种方法-geographic.extent
,它可以是除当前绘制区域之外的所有内容。
# Randomly sample points (same number as our observed points)
background <- randomPoints(mask = mask, # Provides resolution of sampling points
n = nrow(obs.data), # Number of random points
ext = geographic.extent, # Spatially restricts sampling
extf = 1.25) # Expands sampling a little bit
# Plot the base map
plot(wrld_simpl,
xlim = c(0, 30), #north and baltic sea
ylim = c(50, 70),
axes = TRUE,
col = "grey95",
main = "Presence and pseudo-absence points")
# Add the background points
points(background, col = "grey30", pch = 1, cex = 0.75)