PrincipalComponentsBiplot: 'PrincipalComponentsBiplot'

View source: R/principalcomponentsbiplot.R

PrincipalComponentsBiplotR Documentation

PrincipalComponentsBiplot

Description

Performs PCA on a table and outputs biplot

Usage

PrincipalComponentsBiplot(
  x,
  normalization = c("Principal", "Row principal", "Column principal", "Symmetrical",
    "None")[1],
  output = c("Scatterplot", "Moonplot", "Text")[1],
  row.names.to.remove = c("NET", "Total", "SUM"),
  column.names.to.remove = c("NET", "Total", "SUM"),
  row.color = "#5B9BD5",
  col.color = "#ED7D31"
)

Arguments

x

A table containing rows and columns

normalization

Method used to standarize coordinates of biplot. The default method is "Principal", which plots the principal coordinates (i.e., the standard coordinates multiplied by the singular values). "Row principal" and "Column principal" plot the standard coordinates of the columns (rows) against the principal coordinates.

output

Specify output generated. May be one of "Scatterplot", "Moonplot" or "Text".

row.names.to.remove

A vector of the row labels to remove.

column.names.to.remove

A vector of the column labels to remove.

row.color

Color to display row-attributes in scatterplot.

col.color

Color to display column-attributes in scatterplot.

Details

Where a matrix or array is passed in containing names for the dimensions, these are used to represent the rows and columns in the legend. If there are no names, then the names are assumed to be the contents of attr(x, "row.column.names"). If there are still no names, they are assumed to be Rows and Columns, respectively.

Examples

x2 <- cbind(Glance=c(0.016, 0.058, 0.061, 0.038, 0.01),
           FairlyThorough=c(0.022, 0.147, 0.093, 0.128, 0.022),
           VeryThorough=c(0.006,0.064,0.125,0.157,0.051))
rownames(x2) <- c("SomePrimary","PrimaryCompleted","SomeSecondary",
                  "SecondaryCompleted","SomeTertiary")
PrincipalComponentsBiplot(x2, output="Moonplot")


Displayr/flipDimensionReduction documentation built on March 2, 2024, 3:50 a.m.