我正在尝试从 data.frame 中保存 .csv 栅格文件,但发生错误。
library(dismo)
sp <- gbif("Neurergus ","kaiseri")
sp <- sp[sp$basisOfRecord %in% c("HUMAN_OBSERVATION", "OBSERVATION", "PRESERVED_SPECIMEN"), c("lon", "lat")]
sp$species <- 1
sp <- na.omit(sp)
writeRaster(spg, "zzz.csv")
#Error in (function (classes, fdef, mtable) :
# unable to find an inherited method for function ‘writeRaster’ for signature ‘"data.frame", "character"’