get_level_data_geo {geodimension}R Documentation

Get level data with latitude and longitude

Description

Get the data table of a given level with latitude and longitude.

Usage

get_level_data_geo(gd, level_name, inherited, add_prefix, lon_lat, crs)

## S3 method for class 'geodimension'
get_level_data_geo(
  gd,
  level_name = NULL,
  inherited = FALSE,
  add_prefix = TRUE,
  lon_lat = c("intptlon", "intptlat"),
  crs = 4326
)

Arguments

gd

A geodimension object.

level_name

A string.

inherited

A boolean.

add_prefix

A boolean.

lon_lat

A vector, name of longitude and latitude attributes.

crs

A coordinate reference system: integer with the EPSG code, or character with proj4string.

Details

It allows selecting whether we want only the data defined locally in the level or also those that it inherits from other higher levels with which it is related.

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

Additionally, we indicate the names of the fields where longitude and latitude will be stored, as well as the crs that is used, if they are different from the default values.

Value

A tibble object.

See Also

geodimension, geolevel

Other information gathering functions: get_higher_level_names(), get_level_data(), get_level_geometries(), get_level_layer(), get_level_names()

Examples


ld <- gd_us |>
  get_level_data_geo(level_name = "county",
                     inherited = TRUE)


[Package geodimension version 2.0.0 Index]