USA

library('gcensus')
library('mapmisc')

usa = try(gcensus(country = "USA", 
        year = 2000, level = 4, 
        subset = c(name1='Maine'),
        database = c(dbname = "gcensus", user = "gcensus", 
                host = "localhost", port = 5433), 
        income = TRUE, t_srs = "EPSG:3463", simplifyTolerance = 0), silent=TRUE)
if(class(usa) != 'try-error') {
bgMap = openmap(usa, path='waze-us', maxTiles=20)
myCol = colourScale(usa$median_hou, 
        breaks=9, col='Reds',
        opacity=c(0.5, 1), dec=-3)
map.new(usa)
plotRGB(bgMap, add=TRUE)
plot(usa, add=TRUE, col=myCol$plot)
legendBreaks("right", myCol)
scaleBar(usa,'topright')
}


Try the gcensus package in your browser

Any scripts or data that you put into this service are public.

gcensus documentation built on May 2, 2019, 6:49 p.m.