Generate PC1 vs PC2 plots to visualize data with and without outliers. also ouputs dataset with outliers removed.

GeneratePC1andPC2PlotsWithAndWithoutOutliers(
  inputted.data,
  columns.to.do.PCA.on,
  scale.PCA,
  p.value.for.outliers
)

Arguments

inputted.data

A dataframe.

columns.to.do.PCA.on

A vector of strings that specify the column names that should be used for doing PCA.

scale.PCA

Boolean to specify whether or not to scale columns before doing PCA.

p.value.for.outliers

Outliers are defined as samples with either PC1 or PC2 values that have a standard deviation value that meets a specified p-value threshold.

Value

A List with two objects:

  1. Data after removing outliers for PC1 and PC2.

  2. Data from outliers.

Plots will also be displayed.

Details

Outliers are defined as samples with either PC1 or PC2 values that have a standard deviation value that meets a specified p-value threshold.

See also