categories_graph: Create graph of category hierarchy

View source: R/taxonomy.R

categories_graphR Documentation

Create graph of category hierarchy

Description

Create graph of category hierarchy

Usage

categories_graph(taxonomy = NULL)

Arguments

taxonomy

A data frame returned by or NULL.

Value

Categories as a tbl_graph.

Examples

## Not run: 
library(ggraph)

graph <- categories_graph()
# In principle there should be graph data available, but let's check.
if (!is.null(graph)) {
  ggraph(graph, 'tree') +
    geom_edge_link() +
    geom_node_point() +
    geom_node_label(aes(label = category_label)) +
    theme_graph()
}

## End(Not run)

datawookie/trundler documentation built on Dec. 31, 2022, 6:20 p.m.