Skip to contents

Projects an embedded multivariate state space to two dimensions and returns a ggplot object.

By default, the function attempts UMAP projection. If package uwot is not installed, it automatically falls back to PCA.

Embedded points are linked to visualise trajectories and, when ID is present, results are shown in participant-level facets.

Usage

plot_statespace(
  data,
  method = "umap",
  color_by = "ID",
  point_size = 1.8,
  alpha = 0.7,
  seed = 123
)

Arguments

data

An experdyn_statespace object, or an embedded data frame (e.g., x$embedded from make_statespace()).

method

[character(1): "umap"]
Projection method: "umap" or "pca".

color_by

[character(1): "ID"]
Column used for color mapping. If missing from the embedded data, points are shown in a single colour.

point_size

[numeric(1): 1.8]
Point size in the output plot.

alpha

[numeric(1): 0.7]
Point transparency in the output plot.

seed

[integer(1): 123]
Random seed used for UMAP.

Value

A ggplot2::ggplot() object.