2014-05-16 61 views
-2

我有一个生物群体的数据集和地理信息:Maptools:绘制不同地理群体用不同的颜色

结果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) 

但我不知道如何划定多边形s,并更改研究组的颜色选项。

+0

我的歉意,我没有很好地解释:我绘制地图(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) pontos < - data.frame(results2 $ Longitude,results2 $ Latitude) colnames(pontos )= c(“Longitude”,“Latitude”) points(pontos $ Longitude,pontos $ Latitude,pch = 16,col = 2,cex = 1)'但我不知道如何详细说明e的多边形ach组。 – Sergio

回答

-1

我不确定我是否明白“每个组的多边形”是什么意思?您是否可能引用了所谓的“convex hull”:在这种情况下,不少地理信息系统软件包(如sp)应该提供功能...

相关问题