Skip to contents

This function creates a 3D scatter plot of PCA scores using Plotly. It allows for optional coloring by a variable.

Usage

plotPCA(PCAObj, Var = NULL, t = "NULL")

Arguments

PCAObj

A list containing PCA results, including a Scores matrix with PCA scores and a CombinedData dataframe with the original data.

Var

An optional string specifying the variable name in CombinedData to color the points by. Default is NULL.

t

An optional string specifying the type of variable for coloring: "Factor" for categorical variables or anything else for continuous variables. Default is "NULL".

Value

A Plotly object representing the 3D PCA plot.