Learn R Programming

ggfortify (version 0.4.17)

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

Description

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

Usage

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

Value

data.frame

Arguments

model

stats::prcomp or stats::princomp instance

data

original dataset, if needed

...

other arguments passed to methods

Examples

Run this code
if (FALSE) {
fortify(stats::prcomp(iris[-5]))
fortify(stats::prcomp(iris[-5]), data = iris)

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

Run the code above in your browser using DataLab