| visualize_vector_hierarchy | R Documentation |
Displays an ASCII tree representation of the hierarchical structure of Census vectors. This helps users understand the relationship between parent and child vectors when selecting variables for their analysis.
visualize_vector_hierarchy(
vector,
dataset = NULL,
max_depth = NA,
show_type = FALSE,
quiet = FALSE
)
vector |
A Census vector code (e.g., "v_CA16_2510") or a filtered tibble
as returned from |
dataset |
The dataset to query for vector information, e.g. |
max_depth |
Maximum depth of the tree to display. Default is |
show_type |
Logical. If |
quiet |
When |
Invisibly returns a tibble of the vectors displayed in the tree. The tree is printed to the console as a side effect.
## Not run:
# Visualize the age hierarchy for 2016 Census
visualize_vector_hierarchy("v_CA16_2510", dataset = "CA16")
# Show only first two levels with type information
visualize_vector_hierarchy("v_CA16_2510", dataset = "CA16",
max_depth = 2, show_type = TRUE)
# Using a vector tibble from list_census_vectors
library(dplyr)
list_census_vectors("CA16") %>%
filter(vector == "v_CA16_2510") %>%
visualize_vector_hierarchy()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.