Skip to contents

This function adds points onto any ggplot output (including your own plots not created from the ggsem shiny app).

Usage

draw_points(p, points_data, zoom_level = 1)

Arguments

p

A ggplot object

points_data

An object that stores the CSV file containing information about points from the ggsem shiny app.

zoom_level

A numeric value to control the zoom level of the plot. Default is 1.

Value

A ggplot object is returned as the function's output.

Examples

library(ggplot2)

points_data <- data.frame(
x = 20, y = 300, shape = 'square', color = '#D0C5ED', size = 50,
border_color = '#9646D4', border_width = 2, alpha = 1,
locked = FALSE, lavaan = FALSE
)

p <- ggplot(mtcars) + geom_point(aes(mpg, disp))

draw_points(p, points_data, zoom_level = 1.2)