Learn R Programming

geodimension (version 1.0.2)

complete_relation_by_geography: Complete relation by geography

Description

Two levels can be related by attributes or by geography (if the upper level has polygon-type geometry). Once related, if there are unrelated instances, you can try to relate those instances using this function, which considers alternative geographic relationships.

Usage

complete_relation_by_geography(
  gd,
  lower_level_name = NULL,
  upper_level_name = NULL
)

# S3 method for geodimension complete_relation_by_geography( gd, lower_level_name = NULL, upper_level_name = NULL )

Value

A geodimension object.

Arguments

gd

A geodimension object.

lower_level_name

A string, name of the lower level.

upper_level_name

A string, name of the upper lever.

Details

For example, if the lower level has associated point and polygon geometries, only point geometry is considered to establish the initial relationship. Polygon geometry is also considered in this function.

It does not necessarily succeed trying to relate the instances.

See Also

Other level association functions: add_level(), geodimension(), get_unrelated_instances(), relate_levels()

Examples

Run this code
ui <- gd_us |>
  get_unrelated_instances(lower_level_name = "state",
                          upper_level_name = "division")

gd <- gd_us |>
  complete_relation_by_geography(lower_level_name = "state",
                          upper_level_name = "division")

Run the code above in your browser using DataLab