Description Usage Arguments Details Value Author(s) See Also Examples

Perform principal components analysis on a data
matrix and return the results as an object of class `coords`

.

1 |

`x` |
A data matrix, rows are observations, columns are variables. |

`n.comp` |
How many principal components to compute. |

`scale` |
Whether to standardize the columns before doing PCA. |

`compute.scores` |
Whether to compute the scores (i.e. x in the new basis). |

This function performs Principal Component Analysis (PCA) on the
data. Variables are always centred before
the PCA is performed and, if `scale`

is set, the variables
will also be rescaled to unit variance.

If `compute.scores`

is set to `FALSE`

, only the information
required for the `toPC()`

and `fromPC()`

to work is stored
in the returned `coords`

object; otherwise the scores will
be stored in the `$y`

field of the `coords`

object.

The `PCA()`

function is an alternative to
the `prcomp()`

command from the standard library.
The main advantage of `PCA()`

is that the `coords`

class provides functions to convert between the original basis and the
principal component basis.

An object of class `coords`

, with the following
additional components added:

`loadings` |
the loadings, each column is one of the new basis vectors |

`y` |
if |

`var` |
the variance of the data along each of the new basis vectors |

`total.var` |
the total variance of the data |

Jochen Voss <voss@seehuhn.de>

`coords`

;
alternative implementations: `prcomp`

, `princomp`

1 2 3 |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.