This function generates an elbow plot for the principal component analysis (PCA) of the given object.

plotPcaElbow(object, elbow = FALSE)

Arguments

object

An object of class SPATA2 or, in case of S4 generics, objects of classes for which a method has been defined.

elbow

Logical. If TRUE, a vertical line is added to the plot indicating the elbow point.

Value

A ggplot.

Details

This function calculates the standard deviation of each principal component and plots them. If the elbow parameter is set to TRUE, a vertical line is added at the elbow point, which is calculated using a helper function find_elbow_point().