Learn R Programming

geogenr (version 1.0.0)

get_common_flat_table: Get common flat table

Description

Get the layer group data in the form of a flat table that includes all the available data columns for the geodatabases corresponding to the selected years.

Usage

get_common_flat_table(uf, remove_zeros = TRUE, remove_geometry = FALSE)

# S3 method for uscb_folder get_common_flat_table(uf, remove_zeros = TRUE, remove_geometry = TRUE)

Arguments

uf

A uscb_folder object.

remove_zeros

A boolean, remove data with zero value.

remove_geometry

A boolean, remove geometry column.

Value

A tibble object.

Details

Optionally you can delete the rows whose measurement value is zero and remove the geometry column.

See Also

Other result generation functions: get_common_geomultistar(), get_flat_table(), get_geomultistar()

Examples

Run this code
# NOT RUN {
library(tidyr)

folder <- system.file("extdata", package = "geogenr")
folder <- stringr::str_replace_all(paste(folder, "/", ""), " ", "")
ua <- uscb_acs_5ye(folder = folder)
sa <- ua %>% get_statistical_areas()
# sa[6]
# [1] "New England City and Town Area Division"
ul <- uscb_layer(uscb_acs_metadata, ua = ua, geodatabase = sa[6], year = 2015)
layers <- ul %>% get_layer_names()
# layers[3]
# [1] "X02_RACE"
ul <- ul %>% get_layer(layers[3])
lg <- ul %>% get_layer_group_names()
# lg[2]
# [1] "003 - DETAILED RACE"
ul <- ul %>% get_layer_group(lg[2])
uf <- uscb_folder(ul)

layer_common <- uf %>% get_common_flat_table()

# }

Run the code above in your browser using DataLab