Package 'pragr'

Title: Tools for visualising Prague data
Description: A bridge between Prague geodata and R to enable visualisation. Currently, it provides access to raster map layers provided by the Prague geoportal and several utilities.
Authors: Petr Bouchal [aut, cre]
Maintainer: Petr Bouchal <[email protected]>
License: MIT + file LICENSE
Version: 0.3.0.9000
Built: 2024-11-08 04:30:02 UTC
Source: https://github.com/petrbouchal/pragr

Help Index


Median age by district

Description

Median age of each of the 57 districts by 5-year age groups and sex, 2011-2019, from the Czech Statistical Office

Usage

district_age_median

Format

A data frame with 1539 rows and 4 variables:

sex

character. Sex

year

integer. Year, 2011-2019

median_age

double. Median age.

KOD_ZUJ

character. district code (ZUJ code, CZSO codelist 51 http://apl.czso.cz/iSMS/cisdet.jsp?kodcis=51)

Details

Source: https://www.czso.cz/csu/xa/casove-rady-za-mestske-casti-prahy

See Also

Other Statistics: district_age_structure


District population by age and sex

Description

Population of each of the 57 districts by 5-year age groups and sex, 2011-2019, from the Czech Statistical Office

Usage

district_age_structure

Format

A data frame with 9747 rows and 5 variables:

KOD_ZUJ

character. district code (ZUJ code, CZSO codelist 51 http://apl.czso.cz/iSMS/cisdet.jsp?kodcis=51)

KOD_SO

character. admin. district code (CZSO codelist 72 - CISSOP http://apl.czso.cz/iSMS/cisdet.jsp?kodcis=72)

count

double. number of residents.

age

integer. 5-year age group, except 85+.

year

integer. Year; data for 31. 12.

sex

character. Sex.

Details

Source: https://www.czso.cz/csu/xa/casove-rady-za-mestske-casti-prahy

See Also

Other Statistics: district_age_median


Dataset to be used in the geofacet package

Description

Use this as the grid argument to geofacet::facet_geo(). The layout corresponds to district_tilegram.

Usage

district_geofacet

Format

A data frame with 57 rows and 11 variables:

code

character. RUIAN code. Normally should serve as ID to distribute your data points into grid cells.

label

character. Three-character unique label.

row

integer. row number.

col

integer. column number.

See Also

Other Mapping: district_hexogram, district_names, district_tilegram, prg_basemap(), prg_endpoints, prg_tile()


Equal-area hexogram of Prague districts

Description

Equal-area hexogram of 57 Prague districts. Best available representation though some district tiles neighbor districts they do not in reality.

Usage

district_hexogram

Format

A data frame with 57 rows and 11 variables:

kod

character. RUIAN code.

nazev

character. Full name.

label

character. Three-character unique label.

mop_kod

character. Prague district code.

spo_kod

character. Admin district code.

pou_kod

character. Higher-level unit code.

okres_kod

character. District code.

CENTROIX

double. X coordinate of centroid.

CENTROIY

double. Y coordinate of centroid.

row

integer. row number.

col

integer. column number.

geometry

list. geometry.

See Also

Other Mapping: district_geofacet, district_names, district_tilegram, prg_basemap(), prg_endpoints, prg_tile()


Table of several variants of each districts names, with code

Description

For when a shorter label is needed or for linking with other data by name.

Usage

district_names

Format

A data frame with 57 rows and 11 variables:

kod

character. RUIAN code.

label

character. Three-character unique label.

nazev

integer. full name.

name_medium

integer. shortened name.

name_short

integer. short name.

name_spaced

integer. full name with spaced dash.

See Also

Other Mapping: district_geofacet, district_hexogram, district_tilegram, prg_basemap(), prg_endpoints, prg_tile()


Equal-area tilegram of Prague districts

Description

Equal-area tilegram of 57 Prague districts. Best available representation though some district tiles neighbor districts they do not in reality.

Usage

district_tilegram

Format

A data frame with 57 rows and 11 variables:

kod

character. RUIAN code.

nazev

character. Full name.

label

character. Three-character unique label.

mop_kod

character. Prague district code.

spo_kod

character. Admin district code.

pou_kod

character. Higher-level unit code.

okres_kod

character. District code.

CENTROIX

double. X coordinate of centroid.

CENTROIY

double. Y coordinate of centroid.

row

integer. row number.

col

integer. column number.

geometry

list. geometry.

See Also

Other Mapping: district_geofacet, district_hexogram, district_names, prg_basemap(), prg_endpoints, prg_tile()


Prague base maps for ggplot2

Description

Include raster maps from Prague geoportal in your ggplot map

Usage

prg_basemap(
  data,
  image_service = "orto",
  layer = "",
  width = 900,
  alpha = 1,
  buffer = 0,
  verbose = F
)

Arguments

data

sf data frame from which to extract the bounding box

image_service

map service from which to draw the map; prg_endpoints provides details.

layer

layer from map service to use, see https://mpp.praha.eu/arcgis/rest/services/

width

width in pixels, in effect sets image resolution; integer or "max"

alpha

transparency of the tile

buffer

distance between feature end and image end; for EPSG 5514 in meters.

verbose

display information on image URLs and image processing.

Value

list including raster annotation layers for ggplot2

See Also

Other Mapping: district_geofacet, district_hexogram, district_names, district_tilegram, prg_endpoints, prg_tile()

Examples

## Not run: 
praha1 <- CzechData::load_RUIAN_settlement(prg_kod, "MOMC_P", WGS84 = F) %>%
  filter(nazev == 'Praha 1')

ggplot() +
  prg_basemap(data = praha1, alpha = .8, buffer = 200,
              image_service = 'mapy_archiv', layer = 6) +
  geom_sf(data = praha1, fill = alpha("red", 0.6), colour = NA) +
  theme_void()

## End(Not run)

Prague bbox in EPSG 5514 (Krovak)

Description

Prague bbox in EPSG 5514 (Krovak)

Usage

prg_bbox_krovak

Format

named numeric of class bbox, length 4

Prague RUIAN code

See Also

Other Codes and metadata: prg_bbox_wgs84, prg_fua_oecd, prg_ico, prg_kod, prg_kraj, prg_lau1, prg_metro_oecd, prg_nuts2, prg_nuts3, prg_okres_nuts, prg_okres


Prague bbox in EPSG 4326 (WGS 84)

Description

Prague bbox in EPSG 4326 (WGS 84)

Usage

prg_bbox_wgs84

Format

named numeric of class bbox, length 4

Prague RUIAN code

See Also

Other Codes and metadata: prg_bbox_krovak, prg_fua_oecd, prg_ico, prg_kod, prg_kraj, prg_lau1, prg_metro_oecd, prg_nuts2, prg_nuts3, prg_okres_nuts, prg_okres


IPR Map Services

Description

Contains information on a selection of available Prague raster map services. Can be used manually to inspect services and is used internally by prg_tile() and prg_basemap() for retrieving data from servers.

Usage

prg_endpoints

Format

A data frame with 18 rows and 5 variables:

name

character. Name of the service, to be used as parameter in prg_tile() and prg_basemap()

type

character. "tile" or "image"

description

character. Description of the map source

endpoint

character. endpoint. Used internally

url

character. URL, used internally but also points to human readable interface.

See Also

Other Mapping: district_geofacet, district_hexogram, district_names, district_tilegram, prg_basemap(), prg_tile()


Prague code in OECD database of Functional Urban Areas

Description

Prague code in OECD Functional Urban Area database.

Usage

prg_fua_oecd

Format

character vector of length 1

Prague code in OECD Functional Urban Area database.

Details

See https://www.oecd.org/cfe/regional-policy/functionalurbanareasbycountry.htmz

See Also

Other Codes and metadata: prg_bbox_krovak, prg_bbox_wgs84, prg_ico, prg_kod, prg_kraj, prg_lau1, prg_metro_oecd, prg_nuts2, prg_nuts3, prg_okres_nuts, prg_okres


Prague ICO code

Description

Prague ICO code

Usage

prg_ico

Format

character vector of length 1

Prague ICO code

See Also

Other Codes and metadata: prg_bbox_krovak, prg_bbox_wgs84, prg_fua_oecd, prg_kod, prg_kraj, prg_lau1, prg_metro_oecd, prg_nuts2, prg_nuts3, prg_okres_nuts, prg_okres


Prague RUIAN code

Description

Prague RUIAN code

Usage

prg_kod

Format

character vector of length 1

Prague RUIAN code

See Also

Other Codes and metadata: prg_bbox_krovak, prg_bbox_wgs84, prg_fua_oecd, prg_ico, prg_kraj, prg_lau1, prg_metro_oecd, prg_nuts2, prg_nuts3, prg_okres_nuts, prg_okres


Prague 'kraj' code

Description

Prague 'kraj' code. Comes from CZSO registry 100, KRAJ_NUTS.

Usage

prg_kraj

Format

character vector of length 1

Prague kraj code

See Also

Other Codes and metadata: prg_bbox_krovak, prg_bbox_wgs84, prg_fua_oecd, prg_ico, prg_kod, prg_lau1, prg_metro_oecd, prg_nuts2, prg_nuts3, prg_okres_nuts, prg_okres


Prague LAU1 code

Description

Prague LAU1 code - level of okres.

Usage

prg_lau1

Format

character vector of length 1

Prague LAU1 code. Comes from CZSO registry 109 - OKRES_LAU.

See Also

Other Codes and metadata: prg_bbox_krovak, prg_bbox_wgs84, prg_fua_oecd, prg_ico, prg_kod, prg_kraj, prg_metro_oecd, prg_nuts2, prg_nuts3, prg_okres_nuts, prg_okres


Prague code in OECD CITIES database of data on Functional Urban Areas

Description

Prague code in OECD database on Metropolitan Areas.

Usage

prg_metro_oecd

Format

character vector of length 1

Prague code in OECD Functional Urban Area database.

Details

See https://stats.oecd.org/Index.aspx?DataSetCode=CITIES

See Also

Other Codes and metadata: prg_bbox_krovak, prg_bbox_wgs84, prg_fua_oecd, prg_ico, prg_kod, prg_kraj, prg_lau1, prg_nuts2, prg_nuts3, prg_okres_nuts, prg_okres


Prague NUTS2 code

Description

Prague NUTS2 code

Usage

prg_nuts2

Format

character vector of length 1

Prague NUTS2 code

See Also

Other Codes and metadata: prg_bbox_krovak, prg_bbox_wgs84, prg_fua_oecd, prg_ico, prg_kod, prg_kraj, prg_lau1, prg_metro_oecd, prg_nuts3, prg_okres_nuts, prg_okres


Prague NUTS3 code

Description

Prague NUTS3 code, level of kraj. Comes from CZSO registry 108 - NUTS3-2004.

Usage

prg_nuts3

Format

character vector of length 1

Prague NUTS3 code

See Also

Other Codes and metadata: prg_bbox_krovak, prg_bbox_wgs84, prg_fua_oecd, prg_ico, prg_kod, prg_kraj, prg_lau1, prg_metro_oecd, prg_nuts2, prg_okres_nuts, prg_okres


Prague 'okres' code

Description

Prague 'okres' code. Comes from CZSO registry 101 - OKRES_NUTS.

Usage

prg_okres

Format

character vector of length 1

Prague okres code

See Also

Other Codes and metadata: prg_bbox_krovak, prg_bbox_wgs84, prg_fua_oecd, prg_ico, prg_kod, prg_kraj, prg_lau1, prg_metro_oecd, prg_nuts2, prg_nuts3, prg_okres_nuts


Prague 'okres LAU' code

Description

Prague 'okres LAU' code. Comes from CZSO register 101 (OKRES_NUTS) - yes these are confusing but that is how it is.

Usage

prg_okres_nuts

Format

character vector of length 1

Prague okres (NUTS) code.

See Also

Other Codes and metadata: prg_bbox_krovak, prg_bbox_wgs84, prg_fua_oecd, prg_ico, prg_kod, prg_kraj, prg_lau1, prg_metro_oecd, prg_nuts2, prg_nuts3, prg_okres


Prague tiles for ggplot2 plots

Description

Include raster tiles for Prague in ggplot2

Usage

prg_tile(
  data,
  tile_service = "orto",
  zoom = 6,
  alpha = 1,
  buffer = 0,
  verbose = F
)

Arguments

data

sf data frame from which to extract the bounding box

tile_service

map service from which to draw the map (see prg_endpoints), or a URL of a service.

zoom

zoom level, from 0 to the service's limit

alpha

transparency of the tiles.

buffer

distance between feature end and tile end; for EPSG 5514 in meters.

verbose

display information on tile URLs and image processing.

Value

list including raster annotation layers for ggplot2

See Also

Other Mapping: district_geofacet, district_hexogram, district_names, district_tilegram, prg_basemap(), prg_endpoints

Examples

## Not run: 
praha1 <- CzechData::load_RUIAN_settlement(prg_kod, "MOMC_P", WGS84 = F) %>%
  filter(nazev == 'Praha 1')

ggplot() +
prg_tile(data = praha1, zoom = 10, alpha = .7, buffer = 200,
         tile_service = 'orto') +
  geom_sf(data = praha1, fill = alpha("red", 0.6), colour = NA) +
  theme_void()

## End(Not run)