r - Maptools: Plotting different geographic groups with different colors -
i have dataset biological groups , geographic information:
results2
id latitude longitude -3,5 -39,5833 -7,0167 -37,9667 -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
i used maptools plotting these points on map, here code:
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)
but dont know how delimit polygons each group, , change color options of studied groups.
i'm not sure understand mean "the polygons of each group" ? perhaps refering known "convex hull" : in case quite few gis packages (such sp) should supply fiunctionality...
Comments
Post a Comment