prcomp: data.frame-first formula-second method for 'prcomp'

Description Usage Arguments See Also Examples

Description

This function passes a data.frame, formula, and additional arguments to prcomp.

This function passes a data.frame, formula, and additional arguments to prcomp.

Usage

1
2
3
4
5
6
7
8
9
prcomp(data, formula = ~., ...)

## S3 method for class 'prcomp'
predict(object, data, ...)

prcomp(data, formula = ~., ...)

## S3 method for class 'prcomp'
predict(object, data, ...)

Arguments

data

Data frame (or object that can be coerced to one) containing the variables in the model

formula

a formula with no response variable, referring only to numeric variables

...

Additional arguments to pass to model function

object

Fitted model

See Also

prcomp

prcomp

Examples

1
2
3
4
5
6
7
8
prcomp(mtcars)

fit <- prcomp(mtcars, ~ .*.)
predict(fit, mtcars[1:5,])
prcomp(mtcars)

fit <- prcomp(mtcars, ~ .*.)
predict(fit, mtcars[1:5,])

drsimonj/twidlr documentation built on May 15, 2019, 2:53 p.m.