Learn R Programming

geogenr (version 2.0.1)

set_metadata: Set metadata layer

Description

The metadata layer includes the names and description through various fields of the variables contained in the reports.

Usage

set_metadata(geo, metadata)

# S3 method for acs_5yr_geo set_metadata(geo, metadata)

Value

A sf object.

Arguments

geo

An acs_5yr_geo object.

metadata

A tibble object.

Details

When we set the metadata layer, after filtering it, the data layer is also filtered keeping only the variables from the metadata layer.

See Also

Other data exploitation and export functions: as_GeoPackage(), as_acs_5yr_geo(), as_flat_table(), as_geomultistar(), as_star_database(), get_metadata()

Examples

Run this code

act <- anrc_2021_x01 |>
  select_report(report = "B01002-Median Age By Sex")

geo <- act |>
  as_acs_5yr_geo()

metadata <- geo |>
  get_metadata()

metadata <- dplyr::filter(metadata, item2 == "Female")

geo2 <- geo |>
  set_metadata(metadata)

Run the code above in your browser using DataLab