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

View source: R/fortify_stats.R

fortify.prcompR 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

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

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

## End(Not run)

ggfortify documentation built on May 29, 2024, 7:19 a.m.