Description Usage Arguments Value Author(s) References Examples
Transform data from sp to data frame for ggplot2
| 1 | 
| sp | A spatial object to be transformed | 
| region | A string specifying the region of interest | 
| verbose | logical. Should R report extra information on progress? | 
A ggplot2 theme object
Juuso Parkkinen louhos@googlegroups.com
See citation("gisfin")
| 1 2 3 4 5 6 7 8 9 10 | sp.suuralue <- get_helsinki_aluejakokartat(map.specifier="suuralue");
          # Need to load rgeos and maptools for ggplot2::fortify in sp2df() 
          library(rgeos);
          library(maptools);
          # Transform to df and plot with ggplot2
          df.suuralue <- sp2df(sp.suuralue, "Name");
          library(ggplot2);
          theme_set(get_theme_map());
          ggplot(df.suuralue, aes(x=long, y=lat, fill=Name)) + 
          geom_polygon() + theme(legend.position="none")
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.