| draw_loops | R Documentation |
This function overlays self-loop arrows to a ggplot object based on data describing their positions, sizes, orientations, and styles. Self-loop arrows can be drawn in one direction or bidirectionally with customizable parameters such as color, width, and arrow type. The data can come from a CSV file generated by the ggsem Shiny app or custom input.
draw_loops(loops_data, zoom_level = 1)
loops_data |
A data frame containing information about the self-loop arrows. The expected columns include:
|
zoom_level |
Numeric. Adjusts the size of line widths and arrowheads relative to the plot. Default is |
ggplot2 loop layers
library(ggplot2)
loops_data <- data.frame(
x_center = -5, y_center = 5, radius = 2, color = '#000000',
width = 1, alpha = 1, arrow_type = 'closed', arrow_size = 0.1,
gap_size = 0.2, loop_width = 5, loop_height = 5, orientation = 0,
lavaan = TRUE, two_way = FALSE, locked = FALSE, group = 1
)
p <- ggplot()
p + draw_loops(loops_data, zoom_level = 1.2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.