Learn R Programming

applicable (version 0.0.1.1)

autoplot.apd_pca: Plot the distribution function for pcas

Description

Plot the distribution function for pcas

Usage

# S3 method for apd_pca
autoplot(object, ...)

Arguments

object

An object produced by apd_pca.

...

An optional set of dplyr selectors, such as dplyr::matches() or dplyr::starts_with() for selecting which variables should be shown in the plot.

Value

A ggplot object that shows the distribution function for each principal component.

Examples

Run this code
# NOT RUN {
library(ggplot2)
library(dplyr)
library(modeldata)
data(biomass)

biomass_ad <- apd_pca(biomass[, 3:8])

autoplot(biomass_ad)
# Using selectors in `...`
autoplot(biomass_ad, distance) + scale_x_log10()
autoplot(biomass_ad, matches("PC[1-2]"))

# }

Run the code above in your browser using DataLab