Skip to contents

This function predicts the positions of new event data in an existing PCA space using the stats::predict function.

Usage

expand_pca_swarm_space(metrics_data, pca_space, event_dur_limit = NA)

Arguments

metrics_data

A dataframe with the new metrics data to add in swarm space.

pca_space

The PCA object to predict from, the output of the stats::prcomp function or the pca element of the list output of the swarm_space function.

event_dur_limit

Numeric, capturing an event duration value in seconds. Used to filter out events that are shorter that this value. Default = NA, no filtering is applied.

Value

A dataframe with the x and y coordinates in the input swarm space per event of the new species.

See also

Author

Marina Papadopoulou m.papadopoulou.rug@gmail.com

Examples


data(multi_species_metrics)
data(multi_species_pca)
ss <- expand_pca_swarm_space(multi_species_metrics,
multi_species_pca)