我正试图用非洲背景地图绘制研究地点的积分.我可以独立创建这两个,但我很难将它们叠加在彼此之上.
我使用的非洲地图是来自maplibrary.org的Esri shapefile.可以从我的保管箱https://www.dropbox.com/s/etqdw3nky52czv4/Africa%20map.zip获取.我在文本文件中有点,也可以从我的投递箱中获得. https://www.dropbox.com/s/scvymytjsr5pvaf/SPM-437-22Nov12.txt.他们指的是疟疾寄生虫的分子耐药性研究.我想绘制它们,使颜色是具有抗药性遗传标记的寄生虫的比例,并且大小是测试的寄生虫的数量.
独立绘制点数:
qplot(Longitude, Latitude, data = d.spm.437, colour = Frc437, size = Tot437)
Run Code Online (Sandbox Code Playgroud)
绘制非洲地图:
library(maptools)
africa = readShapePoly("Africa.shp")
africa.map = fortify(africa, region="COUNTRY")
qplot(long, lat, data = africa.map, geom="path", group=group)
Run Code Online (Sandbox Code Playgroud)
任何有关将这两者放在一起同时保留点数显示的帮助将不胜感激.
该数据
代码
#
# This is code for mapping of CGE_Morocco results
#
# rm(list = ls(all = TRUE)) # don't use this in code that others will copy/paste
## Loading packages
library(rgdal)
library(plyr)
library(maps)
library(maptools)
library(mapdata)
library(ggplot2)
library(RColorBrewer)
## Loading shape files administrative coordinates for Morocco maps
#Morocco <- readOGR(dsn=".", layer="Morocco_adm0")
MoroccoReg <- readOGR(dsn=".", layer="Morocco_adm1")
## Reorder the data in the shapefile based on the regional order
MoroccoReg <- MoroccoReg[order(MoroccoReg$ID_1), ]
## Add the yield impacts column to …Run Code Online (Sandbox Code Playgroud)