quantide / mapIT

Easy plot Italian maps with R and ggplot package
10 stars 7 forks source link

FYI #3

Closed arilamstein closed 8 years ago

arilamstein commented 9 years ago

italy Just an FYI.

I just saw your article on r-bloggers.com about making a choropleth of Italy:

http://www.r-bloggers.com/building-a-choropleth-map-of-italy-using-mapit/

You might be interested in a package I wrote last month that makes choropleth maps of the states/provinces of country in the world. It's called "choroplethrAdmin1" and you can learn more about it here:

http://rpubs.com/arilamstein/admin1

The example there is for Japan. Here is an example using Italy

# see an outline of the map
library(choroplethrAdmin1)
admin1_map("italy")

# create a choropleth using choroplethr
# choroplethr requires a df with one column named "region" and
# one column named "value"
library(choroplethr)
regions = get_admin1_regions("italy")
df = data.frame(region=regions$region, value=sample(1:length(regions$region)))
admin1_choropleth("italy",
                  df, 
                  "Sample Italy Choropleth", 
                  "Sample")

# see the choroplethr vignettes for examples on zooming and using custom colors

I don't know enough about your package to make a comparison between the two, but I thought you might want to know that this package is out there.