View source: R/metadata_to_ggplot.R
| metadata_to_ggplot | R Documentation |
This function is a convenient wrapper that takes ggsem workflow metadata, extracts the visualization data silently, and converts it to a ggplot object in one step.
metadata_to_ggplot(
metadata,
element_order = c("lines", "points", "loops", "annotations"),
zoom_level = 1,
horizontal_position = 0,
vertical_position = 0,
n = 100
)
metadata |
A list containing ggsem workflow metadata, typically loaded from an RDS file saved by the ggsem Shiny app using the "Export Workflow" functionality or the files directory. |
element_order |
A character vector specifying the order in which graphical elements are added to the plot.
For example: |
zoom_level |
A numeric value controlling the zoom level of the plot. A value >1 zooms in; <1 zooms out. Default is |
horizontal_position |
A numeric value to shift the plot horizontally. Default is |
vertical_position |
A numeric value to shift the plot vertically. Default is |
n |
Number of points used for interpolation in gradient or curved lines. Default is |
This function combines the functionality of ggsem_silent and csv_to_ggplot
into a single convenient call. It's useful when you want to go directly from saved workflow
metadata to a ggplot object without intermediate steps.
A ggplot object with an axis_ranges attribute specifying the x and y axis ranges after adjustments.
## Not run:
# Load a saved ggsem workflow
workflow_metadata <- readRDS("ggsem_workflow_metadata.rds")
# Convert directly to ggplot
p <- metadata_to_ggplot(
metadata = workflow_metadata
)
# Customize the plot further
p + ggtitle("My SEM Visualization")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.