[R] Generating maps in R

Aleksandr Andreev aleksandr.andreev at duke.edu
Sat Mar 29 17:53:58 CET 2008


Greetings!

I am trying plot some data on a map in R. Here's the scenario.

I have a variable called probworkinghealthy which contains a predicted
probability of employment for every individual in my sample (about
100,000 observations).
I have another variable, called a001ter, which contains the subject of
residency in the Russian Federation (akin to a US state) for every
individual in the sample.
I have a shape file with the boundaries of all the subjects, called russia.shp.

I can plot boxplots of the probability by Federal Subject using
plot(probworkinghealthy ~ a001ter). I can also plot the map using
plot(russia.shp)

Now, I would like to plot the mean probability of employment (i.e.
mean(probworkinghealthy)) on a map of Russia using color coding all
the Federal Subjects. Does anyone know how to do something like that?

Much appreciated,

Aleks Andreev
Duke University



More information about the R-help mailing list