Learn R Programming

geodimension (version 1.0.0)

get_level_layer: Get level layer

Description

Get a geographic layer associated with a level. We can select the geometry and, using boolean parameters, which attributes are included in the layer's table: only the attributes that make up the key, the subrogate key, inherited attributes.

Usage

get_level_layer(
  gd,
  level_name = NULL,
  geometry = NULL,
  only_key = FALSE,
  surrogate_key = FALSE,
  inherited = FALSE,
  add_prefix = TRUE
)

# S3 method for geodimension get_level_layer( gd, level_name = NULL, geometry = NULL, only_key = FALSE, surrogate_key = FALSE, inherited = FALSE, add_prefix = TRUE )

Value

A sf object.

Arguments

gd

A geodimension object.

level_name

A string.

geometry

A string.

only_key

A boolean.

surrogate_key

A boolean.

inherited

A boolean.

add_prefix

A boolean.

Details

In case of inheriting attributes from other levels, in the table, these can have as a prefix the name of the level in uppercase.

See Also

Other information output functions: get_higher_level_names(), get_level_data(), get_level_geometries(), get_level_names()

Examples

Run this code
library(tidyr)
library(sf)

ll <- gd_us %>%
  get_level_layer(level_name = "division",
                  only_key = TRUE,
                  surrogate_key = TRUE)

Run the code above in your browser using DataLab