powered by
prcomp
This function passes a data.frame, formula, and additional arguments to prcomp.
prcomp(data, formula = ~., ...)# S3 method for prcomp predict(object, data, ...)prcomp(data, formula = ~., ...)# S3 method for prcomp predict(object, data, ...)
# S3 method for prcomp predict(object, data, ...)
prcomp(data, formula = ~., ...)
prcomp(mtcars) fit <- prcomp(mtcars, ~ .*.) predict(fit, mtcars[1:5,]) prcomp(mtcars) fit <- prcomp(mtcars, ~ .*.) predict(fit, mtcars[1:5,])
Run the code above in your browser using DataLab