Skip to content
Prev 279731 / 398506 Next

map at fips level using multiple variables

Hi David,

Sorry it sounds vague.

Here is my current code, which gives the distribution of family size  
at US county level. You will see on a US map family size distribution  
represented by different colors.

Now if i have another variable income, which has 3 categories(<50k,  
50k-80k,>80k). How do I show 5x3 categories on the map? I guess I  
could always create a third variable to do this. Just wondering maybe  
there is a function to do this readily?

Thank you!
Bonnie Yuan

y=data1$size
x11()
hist(y,nclass=15) # histogram of y
fivenum(y)
# specify the cut-off point of y
y.colorBuckets=as.numeric(cut(y, c(1,2, 3,6)))
# legend showing the cut-off points.
legend.txt=c("0-1","1-2","2-3","3-6",">6")
colorsmatched=y.colorBuckets[match(county.fips$fips,fips[,1])]
x11()
map("county", col = colors[colorsmatched], fill = TRUE, resolution = 0)
map("state", col = "white", fill = FALSE, add = TRUE, lty = 1, lwd = 0.2)
title("Family Size")
legend("bottom", legend.txt, horiz = TRUE, fill = colors, cex=0.7)



Quoting David Winsemius <dwinsemius at comcast.net>: