Skip to content

Instantly share code, notes, and snippets.

@mbacou
Created March 25, 2013 16:29
Show Gist options
  • Save mbacou/5238439 to your computer and use it in GitHub Desktop.
Save mbacou/5238439 to your computer and use it in GitHub Desktop.
R: Draw random dot-density maps
# Random dot density maps
dots.rand <- dotsInPolys(gha, gha@data$total, f="random")
plot(dots.rand,
pch=19, cex=0.4, col="red",
add=TRUE)
text(coordinates(gha.reg),
labels=gha.reg@data$REGION,
adj=c(0, 0), cex=.9, col="black", xpd=NA)
title("Sampled Households by District [GHA-GLSS5]")
legend(gha.reg@data$REGION,
title="Administrative Regions",
fill=col[factor(gha.reg@data$REGION)],
x="left", y="bottom", cex=.8, bty="n")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment