Principal component analysis | R Documentation |

Principal component analysis.

```
pca(x, center = TRUE, scale = TRUE, k = NULL, vectors = FALSE)
```

`x` |
A numerical |

`center` |
Do you want your data centered? TRUE or FALSE. |

`scale` |
Do you want each of your variables scaled, i.e. to have unit variance? TRUE or FALSE. |

`k` |
If you want a specific number of eigenvalues and eigenvectors set it here, otherwise all eigenvalues (and eigenvectors if requested) will be returned. |

`vectors` |
Do you want the eigenvectors be returned? By dafault this is FALSE. |

The function is a faster version of R's prcomp.

A list including:

`values` |
The eigenvalues. |

`vectors` |
The eigenvectors. |

Michail Tsagris.

R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.

```
reg.mle.lda
```

```
x <- matrix( rnorm(1000 * 20 ), ncol = 20)
a <- pca(x)
x <- NULL
```

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.