[R-sig-Geo] Mapping multiple attributes at once

Pierre Roudier pierre.roudier at gmail.com
Tue Aug 24 11:52:06 CEST 2010


Hi Thiago,

My weapon of choice for that would be to use the ggplot2 library.

Here is a quick example. I *hope* it is reproducible (I on't have R
installed on the machine I am posting from):

# here is a sample data frame with locations, a categorical variable
and a continuous variable
dat <- data.frame(x=runif(5), y=runif(5), category=letters(5),
continuous=runif(5))

# You may want to do some spatial analysis on that data.frame
library(sp)
coordinates(dat) <- ~x+y

# Some spatial analysis here

# Now you want to plot it
library(ggplot2)
df <- as.data.frame(dat) # backtransforms dat into a data.frame object
my.plot <- ggplot(data=df, aes(x=x, y=y)) +
geom_point(aes(size=category, fill=continuous))
print(my.plot)

For more info on theggplot2 options see http://had.co.nz/ggplot2/

HTH,

Pierre

2010/8/24 Thiago Veloso <thi_veloso at yahoo.com.br>:
>   Dear SIG colleagues,
>   In my present study I need to plot a map containing two different attributes of some localities.    I figured out that a convenient and didactic way would be via something like bubble plots. For example, the size of the circle would be proportional to a certain range of values (4 categories) and its inner colors (also 4 categories) would be proportional to the p-values of a statistical test.
>   Is it possible to implement that idea using SIG tools in R? Any suggestions on how to do it??
>   Thanks in advance and best wishes,
>   Thiago.
>
>
>
>        [[alternative HTML version deleted]]
>
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
>



More information about the R-sig-Geo mailing list