GithubHelp home page GithubHelp logo

sweboundaries's Introduction

SweBoundaries

R data for Swedish administrative boundaries of counties and municipalities from 1977-2008.

library(sweboundaries)
library(dplyr)
library(ggplot2)

m <- swe_boundaries(1996, "mun", "df")

data(geo_pop)

md <- geo_pop %>% filter(year == 1996) %>% 
  left_join(m, ., by = "knkod") %>% 
  mutate(
    dens = pop/(area/100),
    dens = cut(dens, quantile(dens), labels = c(1:4))
    )
knitr::kable(md %>% select(geomid:year) %>% distinct() %>% slice(1:10))
geomid area knkod knnamn from tom pop year
01149999 90345207 0114 Upplands Väsby 1977 2006 36277 1996
01369999 388838630 0136 Haninge 1977 2006 65706 1996
12569999 460238995 1121 Östra Göinge 1977 1996 15061 1996
12579999 343676138 1137 Örkelljunga 1977 1996 9650 1996
12609999 115369517 1260 Bjuv 1977 2006 14199 1996
12619999 166011795 1261 Kävlinge 1977 2006 24169 1996
12629999 56075589 1262 Lomma 1977 2006 17576 1996
12639999 221151506 1263 Svedala 1977 2006 17915 1996
12649999 205789842 1264 Skurup 1977 2006 13680 1996
12659999 514762507 1265 Sjöbo 1977 2006 16571 1996
ggplot(md, aes(long, lat, group = group, fill = dens)) +
  scale_fill_brewer() +
  geom_polygon() + coord_equal() + theme_minimal()

Credits

Inspired by USAboundaries

Data from SCB

sweboundaries's People

Contributors

junkka avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.