I want to draw barchart over map as on this page: http://docs.oracle.com/cd/E16162_01/web.1112/e16181/dv_map.htm#BEHHAFEJ
I used following data and code but it is not working.
ddf = read.table(header=T, sep=",", text="
country, val1, val2, val3
Nigeria,5,10,8
China,8,12,20
Brazil,15,9,20
Italy,9,25,5
Australia,15,5,25
")
require (rworldmap)
sPDF <- joinCountryData2Map(ddf
, joinCode = "NAME"
, nameJoinColumn = "country"
, verbose = TRUE)
mapBars( sPDF,
, nameZs=c(ddf$val1, ddf$val2, ddf$val3)
, symbolSize=4 )
How can I correct this? Please help.
Edit:
I tried using code in answer below but I am getting an empty window plot with error: Error in par(plt = c(xyx, xyy), new = TRUE) :
invalid value specified for graphical parameter "plt"
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…