Learn R Programming

ggsem (version 0.9.9)

ggsem_silent: Run ggsem silently (without launching the app) and get the visualization outputs

Description

This function processes a saved ggsem workflow metadata file and extracts all visualization data (points, lines, annotations, loops) that would be displayed in the Shiny app. It reproduces both SEM and network visualizations from the saved session state.

Usage

ggsem_silent(metadata)

Value

A list of four data frames:

  • points - Data frame containing point coordinates and properties

  • lines - Data frame containing line coordinates and properties

  • annotations - Data frame containing text annotations

  • loops - Data frame containing loop coordinates and properties

Arguments

metadata

A file path of metadata or a list containing ggsem workflow metadata, typically loaded from an RDS file saved by the ggsem Shiny app using the "Export Workflow" functionality. The metadata should contain SEM groups, network groups, visual elements, and group labels.

Examples

Run this code
if (FALSE) {
# Load a saved ggsem workflow
workflow_metadata <- readRDS("ggsem_workflow_20240101_120000.rds")

# Extract visualization data
viz_data <- ggsem_silent(workflow_metadata)

# Access the different components
points <- viz_data$points
lines <- viz_data$lines
annotations <- viz_data$annotations
loops <- viz_data$loops
}

Run the code above in your browser using DataLab