我有一个包含生物群及其地理信息的数据集:
结果2
ID Latitude Longitude
A -3,5 -39,5833
A -7,0167 -37,9667
A -9,2258 -43,4631
B -16,6667 -49,5
B -15,4333 -55,75
B -19,0333 -57,2167
C -29,2 -58,1
C -30 -59,5167
C -34,5667 -59,1167
我使用 maptools 在地图上绘制这些点,这里的代码:
xlim<-c(min(results2$Longitude),max(results2$Longitude))
ylim<-c(min(results2$Latitude),max(results2$Latitude))
readShapeLines("americas_adm0.shp") -> shape
plot(shape, xlim=xlim, ylim=ylim)
par(new=TRUE)
## vamos aqui!!
pontos<- data.frame(results2$Longitude,results2$Latitude)
colnames(pontos)=c("Longitude","Latitude")
points(pontos$Longitude, pontos$Latitude, pch=16, col=2, cex=1)
但我不知道如何为每个组划定多边形,并更改所研究组的颜色选项。