Learn R Programming

gglyph (version 0.2.0)

generate_mock_data: Generate mock data for gglyph::geom_glyph()

Description

Generates custom mock data to be passed to gglyph::geom_glyph().

Usage

generate_mock_data(
  n_nodes = 5,
  n_edges = 7,
  n_groups = 1,
  statistical = FALSE,
  p_threshold = 0.05
)

Value

A data frame with mock data for nodes and edges.

Arguments

n_nodes

Number of nodes in the graph. Default is 5.

n_edges

Number of edges to generate. Default is 7.

n_groups

Number of groups (for faceting). Default is 1 (ungrouped).

statistical

If TRUE, generates mock p-values for edges. Default is FALSE.

p_threshold

The significance threshold for filtering edges. Default is 0.05.

Examples

Run this code
# For non-grouped data
mock_data <- generate_mock_data(
  n_nodes = 5,
  n_edges = 7,
  n_groups = 1,
  statistical = FALSE,
  p_threshold = 0.05
)

# For grouped data
mock_data <- generate_mock_data(
  n_nodes = 5,
  n_edges = 7,
  n_groups = 3,
  statistical = TRUE,
  p_threshold = 0.05
)

Run the code above in your browser using DataLab