Plot of PCA results

plot_pca is a simple utility function to plot the results from a PCA analysis.

plot_pca(
  pc,
  pch = 16,
  col = "#000000",
  pc_x = 1,
  pc_y = 2,
  main = "",
  labels = NULL,
  ...
)

Arguments

pc

the result from a principal component analysis (i.e. the result returned by prcomp.

pch

the point character. See plot() or par() for more information.

col

the color to be used for each data point/sample.

pc_x

integer(1) defining which principal component should be drawn on the x-axis.

pc_y

integer(1) defining the principal component to be drawn on the y-axis.

main

character(1) with the optional title of the plot.

labels

character with length equal to the number of samples. If provided, these will be displayed instead of data points.

...

additional arguments to be passed to the points() or text() calls (if labels = NULL or not).

Author

Johannes Rainer