R: Convert 'stats::prcomp', 'stats::princomp' to 'data.frame'

fortify.prcomp {ggfortify} | R Documentation

## Convert `stats::prcomp`, `stats::princomp` to `data.frame`

### Description

Convert `stats::prcomp`, `stats::princomp` to `data.frame`

### Usage

    ## S3 method for class 'prcomp'
    fortify(model, data = NULL, ...)

### Arguments

`model` | `stats::prcomp` or `stats::princomp` instance
`data` | original dataset, if needed
`...` | other arguments passed to methods

### Value

data.frame

### Examples

    fortify(stats::prcomp(iris[-5]))
    fortify(stats::prcomp(iris[-5]), data = iris)

    fortify(stats::princomp(iris[-5]))
    fortify(stats::princomp(iris[-5]), data = iris)

[Package ggfortify version 0.4.3 Index]