mirror of
https://github.com/kidwellj/hacking_religion_cookbook.git
synced 2024-11-01 01:12:21 +00:00
first commit
This commit is contained in:
parent
986fe916af
commit
e519b8bcda
|
@ -10,6 +10,7 @@ You can view a live demo of the textbook book here: [https://kidwellj.github.io/
|
||||||
Recipes included here include:
|
Recipes included here include:
|
||||||
* `nomis.R` Supporting content in chapter 1 which relies on UK census data. This was extracted from the nomis database using R tools
|
* `nomis.R` Supporting content in chapter 1 which relies on UK census data. This was extracted from the nomis database using R tools
|
||||||
* `ordnance_survey.R` Supporting geospatial content in chapter 3 which relies on Ordnance Survey geospatial data
|
* `ordnance_survey.R` Supporting geospatial content in chapter 3 which relies on Ordnance Survey geospatial data
|
||||||
|
* `openstreetmap_parse.R` Script which can generate extracts from the OpenStreetMap database for content used in chapter 3
|
||||||
|
|
||||||
# Copyright
|
# Copyright
|
||||||
|
|
||||||
|
|
26
nomis.R
26
nomis.R
|
@ -1 +1,25 @@
|
||||||
nomis.R
|
# Process to explore nomis() data for specific datasets
|
||||||
|
library(nomisr)
|
||||||
|
|
||||||
|
# You'll want to start by browsing the nomis dataset towards getting dataset ID (like "NM_529_1" below)
|
||||||
|
religion_search <- nomis_search(name = "*Religion*")
|
||||||
|
religion_measures <- nomis_get_metadata("ST104", "measures")
|
||||||
|
tibble::glimpse(religion_measures)
|
||||||
|
religion_geography <- nomis_get_metadata("NM_529_1", "geography", "TYPE")
|
||||||
|
|
||||||
|
# grab daata from nomis for 2001 census religion / ethnicity
|
||||||
|
z0 <- nomis_get_data(id = "NM_1872_1", time = "latest", geography = "TYPE499", measures=c(20100))
|
||||||
|
saveRDS(z0, file = "z0.rds")
|
||||||
|
|
||||||
|
# Get table of Census 2011 religion data from nomis
|
||||||
|
z <- nomis_get_data(id = "NM_529_1", time = "latest", geography = "TYPE499", measures=c(20301))
|
||||||
|
saveRDS(z, file = "z.rds")
|
||||||
|
z <- readRDS(file = (here("example_data", "z.rds")))
|
||||||
|
|
||||||
|
# grab data from nomis for 2011 census religion / ethnicity table
|
||||||
|
z1 <- nomis_get_data(id = "NM_659_1", time = "latest", geography = "TYPE499", measures=c(20100))
|
||||||
|
saveRDS(z1, file = "z1.rds")
|
||||||
|
|
||||||
|
# grab data from nomis for 2021 census religion / ethnicity table
|
||||||
|
z2 <- nomis_get_data(id = "NM_2131_1", time = "latest", geography = "TYPE499", measures=c(20100))
|
||||||
|
saveRDS(z2, file = "z2.rds")
|
||||||
|
|
Loading…
Reference in a new issue