You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

在R语言中绘制采样点地图遇阻,恳请技术指导

求助:完善R语言绘制岛屿采样点地图的代码

各位好!我正在做大学的一项重要作业,需要绘制数据采集阶段的采样点地图。我已经写了一部分R代码,但卡在后续完善的环节了,现在把代码和采样点数据贴出来,希望能得到大家的技术建议,非常感谢!


我的现有代码

library(maps)
Sampling_coord <- read.csv() # Localisation of the file with all the coordinates
palette(c("yellow","green","red")) # Project only islands
png(, res=300, width = 15, height = 15, units = "cm") # Create a file in output
map(xlim =c(-10,0), ylim=c(55,60), fill=F, col="black",mar=c(1,1,1,1)) # coordinates of the area
islands=subset(Sampling_coord, Project == 'Island') # Substract only the island samples
points(islands$Long,islands$Lat,col=islands$SiteMiteBees,pch=19) # Put the points on the map and color by type of site
# Put the labels on the sites
text(islands$Long, islands$Lat,label=islands$Code, cex=0.8, adj=1.4)
legend("bottomright",legend=unique(islands$SiteMiteBees),pch=19,col=unique(islands$SiteMiteBees),cex=0.6)
dev.off()

采样点数据说明

我的采样点数据是分号分隔的格式,列对应:纬度、经度、站点编码(Code)、项目类型(Project)、瓦螨状态(Varroa)、蜜蜂状态(Honey Bees)、站点分类(SiteMiteBees),具体数据如下:

58.223914;-6.386988;L;Island;Varroa;Honey Bees;Island + Varroa + Honey Bees
57.051801;-5.923568;S;Island;Varroa;Honey Bees;Island + Varroa + Honey Bees
56.598782;-6.627109;Coll;Island;Varroa;Honey Bees;Island + Varroa + Honey Bees
56.62349;-6.073362;Mull;Island;NoVarroa;Honey Bees;Island + Honey Bees
55.698677;-6.445954;I;Island;NoVarroa;Honey Bees;Island + Honey Bees
56.959589;-7.443962;B;Island;NoVarroa;Honey Bees;Island + Honey Bees
56.068724;-6.196989;C;Island;NoVarroa;Honey Bees;Island + Honey Bees
57.153458;-7.308724;SU;Island;NoVarroa;No Honey Bees;Island
57.084832;-7.310713;E;Island;NoVarroa;No Honey Bees;Island
57.010631;-6.265324;R;Island;NoVarroa;No Honey Bees;Island

内容的提问来源于stack exchange,提问作者Boru445

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.07 09:27:54