我希望能够在与文档数量相关的图表上创建一个带有圆圈的世界地图。
这是我尝试使用 mapBubbles 来完成的,但是在绘制图表时出现了问题。
我拥有的数据文件如下:
ISO3V10 Country No of Documents Lat Lon
ARG Argentina 41 -64 -34
AUS Australia 224 133 -27
CAN Canada 426 -95 60
IRL Ireland 68 -8 53
ITA Italy 583 12.8333 42.8333
NLD Netherlands 327 5.75 52.5
NZL New Zealand 26 174 -41
ESP Spain 325 -4 40
GBR United Kingdom 2849 -2 54
USA United States 3162 -97 38
我写的代码如下:
# Thanks to Andrie for the reproducible code and Paolo for the suggested edit
zz <-"ISO3V10 Country No.of.Documents Lat Lon
ARG Argentina 41 -64 -34
AUS Australia 224 133 -27
CAN Canada 426 -95 60
IRL Ireland 68 -8 53
ITA Italy 583 12.8333 42.8333
NLD Netherlands 327 5.75 52.5
NZL 'New Zealand' 26 174 -41
ESP Spain 325 -4 40
GBR 'United Kingdom' 2849 -2 54
USA 'United States' 3162 -97 38
"
dF2 <- read.table(textConnection(zz), header = TRUE)
# dF2 <- read.delim(file="C:\\Users\\js207963\\Documents\\noofpublications_AllUpdated.txt", header = TRUE, sep = "\t")
dF2[]
par(mai=c(0,0,0.2,0),xaxs="i",yaxs="i")
mapBubbles(dF2=getMap(), nameZSize="No.of.Documents", nameZColour="Country",oceanCol="lightblue", landCol="wheat", addLegend=FALSE
所以问题是你能帮我修复代码以正确绘制数据吗?
干杯,杰斯