Produces diagnostic plots for a glow_pcs object. Dispatches to either a scree plot or a PC scatter matrix based on the type argument.

# S3 method for class 'glow_pcs'
plot(x, type = c("scree", "pairs"), n_pairs = 4L, ...)

Arguments

x

A glow_pcs object returned by compute_pcs_gds.

type

Character. Plot type: "scree" for a scree plot with individual eigenvalues (bars) and cumulative variance (line), or "pairs" for a scatter plot matrix of the first n_pairs PCs. Default: "scree".

n_pairs

Integer. Number of PCs to include in the pairs plot. Only used when type = "pairs". Default: 4.

...

Additional graphical parameters passed to the underlying plot functions.

Value

Invisibly returns x.

Examples

if (FALSE) { # \dontrun{
pcs <- compute_pcs_gds(gds_files, n_pcs = 20)

# Scree plot
plot(pcs, type = "scree")

# PC scatter matrix
plot(pcs, type = "pairs", n_pairs = 6)
} # }