powered by
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.
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 )
# S3 method for geodimension get_level_layer( gd, level_name = NULL, geometry = NULL, only_key = FALSE, surrogate_key = FALSE, inherited = FALSE, add_prefix = TRUE )
A sf object.
sf
A geodimension object.
geodimension
A string.
A boolean.
In case of inheriting attributes from other levels, in the table, these can have as a prefix the name of the level in uppercase.
Other information output functions: get_higher_level_names(), get_level_data(), get_level_geometries(), get_level_names()
get_higher_level_names()
get_level_data()
get_level_geometries()
get_level_names()
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