MyNixOS website logo
Description

Official Gridded Data from the German Census 2022.

Provides fast and easy access to German census grid data from the 2011 and 2022 censuses <https://www.zensus2022.de/>, including a wide range of socio-economic indicators at multiple spatial resolutions (100m, 1km, 10km). Enables efficient download, processing, and analysis of large census datasets covering population, households, families, dwellings, and buildings. Harmonized data structures allow direct comparison with the 2011 census, supporting temporal and spatial analyses. Facilitates conversion of data into common formats for spatial analysis and mapping ('terra', 'sf', 'ggplot2').

z22

R-CMD-check Lifecycle:stable CRANstatus Project Status: Active – The project has reached a stable, usablestate and is being activelydeveloped. Codecov testcoverage CodeFactor

As part of the German census, a number of socio-economic indicators are published at a small-scale grid level (100m, 1km, 10km). Usually the corresponding data files are very large and hard to work with. {z22} aims to quickly and efficiently retrieve German census grid data. The package also eases comparisons to grid data from the census 2011 by establishing a standardized feature format.

Powered by the z22data data repository which hosts the census grid data in small and digestible chunks. Based on the predecessor package z11 which allows easy access to the gridded data from the Census 2011.

Installation

You can install the development version of z22 like so:

pak::pkg_install("jslth/z22")

Example

The package contains a main function, z22_data, to retrieve and process census grid data. The following example downloads a feature grid on the vacancy share in Germany at a 1x1 km resolution.

library(z22)
library(terra)

grid_vac <- z22_data("vacancies", res = "10km", rasterize = TRUE)
grid_vac
#> class       : SpatRasterDataset 
#> subdatasets : 1 
#> dimensions  : 87, 65 (nrow, ncol)
#> nlyr        : 1 
#> resolution  : 10000, 10000  (x, y)
#> extent      : 4035000, 4685000, 2685000, 3555000  (xmin, xmax, ymin, ymax)
#> coord. ref. : ETRS89-extended / LAEA Europe (EPSG:3035) 
#> source(s)   : memory 
#> names       : cat_0
Code for the plot
library(ggplot2)

df_vac <- z22_pivot_longer(grid_vac, "vacancies")
ggplot(df_vac) +
  geom_tile(aes(x, y, fill = value)) +
  coord_sf(crs = 3035) + 
  facet_wrap(~category, nrow = 2) +
  scale_fill_viridis_c("Share", na.value = "transparent", transform = "log2") +
  theme_bw() +
  labs(x = NULL, y = NULL) +
  theme(panel.grid = element_blank(), axis.text = element_blank())

Available data

ThemeNameDescriptionZensus22Zensus11 (100m)Zensus11 (1km)
PopulationpopulationPopulation
PopulationcitizensNumber of german citizens, 18 or older
PopulationforeignersShare of foreigners
Populationforeigners_from_18Share of foreigners, 18 or older
Populationbirth_countryCountry of birth (groups)
PopulationsexSex
PopulationwomenShare of women
PopulationreligionReligion
PopulationcitizenshipCitizenship
Populationcitizenship_groupCitizenship (groups)
Populationcitizenship_originCitizenship by selected countries
Populationcitizenship_totalNumber of citizenships
Populationage_avgAverage age
Populationage_shortAge (five classes of years)
Populationage_longAge (ten years age groups)
Populationage_under_18Share of people under 18
Populationage_from_65Share of people 65 or older
Populationmarital_statusMarital status
FamiliesfamiliesTotal number of families
Familiesfamily_typeType of core family (by children)
Familiesfamily_sizeSize of core family
HouseholdshouseholdsTotal number of private households
Householdshousehold_familyPrivate households by family types
Householdshousehold_lifestylePrivate households by lifestyle
Householdshousehold_seniorPrivate households by senior status
Householdshousehold_size_avgAverage household size
Householdshousehold_size_groupHousehold size (groups)
DwellingsdwellingsTotal number of dwellings
Dwellingsrent_avgAverage net cold rent
Dwellingsdwelling_occupancyUse by household occupancy
Dwellingsdwelling_ownership_homeOwnership of the dwelling
Dwellingsdwelling_ownership_propertyDwellings by form of ownership
Dwellingsowner_occupierShare of owner occupiers
DwellingsvacanciesShare of vacancies
Dwellingsmarket_vacanciesShare of market active vacancies
Dwellingsinhabitant_spaceAverage living space per inhabitant
Dwellingsdwelling_spaceAverage living space per dwelling
Dwellingsfloor_spaceFloor space of the dwelling (10m² intervals)
Dwellingsdwelling_roomsDwellings by number of rooms
Dwellingsdwelling_constr_yearDwellings by construction year (microcensus classes)
Dwellingsdwelling_building_dwellingsDwellings by number of dwellings in the building
Dwellingsdwelling_building_sizeDwellings by building type and size
Dwellingsdwelling_building_typeDwellings by residential usage type
Dwellingsdwelling_building_designDwelling by building design
Dwellingsdwelling_heat_typeDwellings by predominant heating type
Dwellingsdwelling_heat_srcDwellings by energy source of heating
BuildingsbuildingsTotal number of buildings
Buildingsbuilding_ownership_propertyBuildings by form of ownership
Buildingsbuilding_constr_yearBuildings by construction year (microcensus classes)
Buildingsbuilding_dwellingsResidential buildings by number of dwellings in the building
Buildingsbuilding_sizeResidential buildings by building type and size
Buildingsbuilding_typeBuildings by residential usage type
Buildingsbuilding_designBuildings by building design
Buildingsbuilding_heat_typeBuildings by predominant heating type
Buildingsbuilding_heat_srcBuildings by energy source of heating
Metadata

Version

1.0.0

License

Unknown

Platforms (76)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows