plot_prcomp: Visualize principal component analysis

Description Usage Arguments Details Value Note Examples

View source: R/plot_prcomp.r

Description

Visualize output of prcomp.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
plot_prcomp(
  data,
  variance_cap = 0.8,
  maxcat = 50L,
  prcomp_args = list(scale. = TRUE),
  geom_label_args = list(),
  title = NULL,
  ggtheme = theme_gray(),
  theme_config = list(),
  nrow = 3L,
  ncol = 3L,
  parallel = FALSE
)

Arguments

data

input data

variance_cap

maximum cumulative explained variance allowed for all principal components. Default is 80%.

maxcat

maximum categories allowed for each discrete feature. The default is 50.

prcomp_args

a list of other arguments to prcomp

geom_label_args

a list of other arguments to geom_label

title

plot title starting from page 2.

ggtheme

complete ggplot2 themes. The default is theme_gray.

theme_config

a list of configurations to be passed to theme.

nrow

number of rows per page

ncol

number of columns per page

parallel

enable parallel? Default is FALSE.

Details

When cumulative explained variance exceeds variance_cap, remaining principal components will be ignored. Set variance_cap to 1 for all principal components.

Discrete features containing more categories than maxcat specifies will be ignored.

Value

invisibly return the named list of ggplot objects

Note

Discrete features will be dummify-ed first before passing to prcomp.

Missing values may create issues in prcomp. Consider na.omit your input data first.

Features with zero variance are dropped.

Examples

1

DataExplorer documentation built on Jan. 8, 2020, 1:09 a.m.