Dear R'ers, I am wondering what is the smallest geographicterritorial unit available for formatting in Canada. Provinces? I know that in the US it is the county so that I can color US counties any way I want, for example: ### Example for coloring US counties ### Creating an ARTIFICIAL criterion for coloring US counties: library(maps) allcounties<-data.frame(county=map('county', plot=FALSE)$names) allcounties$group<-c(rep(1:6,513),rep(1,4))[order(c(rep(1:6,513),rep(1,4)))] ### My colors: mycolors <- rainbow(6) map('county',fill=TRUE,col=mycolors[allcounties$group],resolution=0,lty=0,bg = "transparent") map('state', lwd=1, add=TRUE) I would like to do something similar for Canada. I see that maps knows Canadian cities: map("world", "Canada") map.cities(country = "Canada",Capitals = 2) But how could I access and map Canada's provinces? Or maybe there are some even smaller territorial units in Canada (like counties in the US)? If yes, then in what package are they accessible? Thanks a lot! -- Dimitri Liakhovitski marketfusionanalytics.com
On Wed, Jan 25, 2012 at 9:25 PM, Dimitri Liakhovitski <dimitri.liakhovitski at gmail.com> wrote:> Dear R'ers, > > I am wondering what is the smallest geographicterritorial unit > available for formatting in Canada. Provinces? > > > I know that in the US it is the county so that I can color US > counties any way I want, for example: > > ### Example for coloring US counties > ### Creating an ARTIFICIAL criterion for coloring US counties: > library(maps)If you want to extend your skills beyond the map package then you can plot anything that you can get a shapefile, or other common geospatial data set of, using the sp packages and friends such as maptools and rgdal. gadm has four levels of Canadian boundaries, at first glance - country, province (black), something smaller than province (blue) and then red which looks like urban divisions. The province upper-left doesn't seem to have any blue subdivisions, but that's possibly because there would be more subdivisions than people who actually live there. http://www.gadm.org/download Gadm also has a facility to download the data as .Rdata objects that can load straight into R. You might want to ask questions about spatial data programming on R-sig-geo or even on www.stackoverflow.com with the R tag. Barry
Seemingly Similar Threads
- Overimposing one map in ssplot onto another
- Change state names to abbreviations in an irregular list of names, abbreviations, null values, and foreign provinces
- Labelling a fortified GADM map plotted with ggplot and geom_map
- plot single part of the country using gadm map
- Data for use in maps()