A two-dimensional embedding scatter with optional cluster hulls, so cluster shape is visible rather than inferred from point color alone.
geom_embedding(
mapping = NULL,
data = NULL,
hull = TRUE,
size = NULL,
alpha = NULL
)A Layer to add with +.
set.seed(1)
d <- data.frame(
d1 = c(rnorm(30), rnorm(30, 4)), d2 = c(rnorm(30), rnorm(30, 3)),
cl = rep(c("a", "b"), each = 30)
)
ggnext(d, aes(d1, d2, color = cl)) + geom_embedding()
#> <ggnext plot>
#> data: 60 x 3
#> aes: x = d1, y = d2, color = cl
#> layers: 1
#> coord: cartesian
#> mode: static