pipe: Pipe functions

Description Arguments Examples

Description

Like dplyr, anomalyDetection also uses the pipe function, %>% to turn function composition into a series of imperative statements.

Arguments

lhs, rhs

An R object and a function to apply to it

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
x <- matrix(rnorm(200*3), ncol = 10)
N <- nrow(x)
p <- ncol(x)

# Instead of
hc <- horns_curve(x)
fa <- factor_analysis(x, hc_points = hc)
factor_analysis_results(fa, fa_scores_rotated)

# You can write
horns_curve(x) %>%
  factor_analysis(x, hc_points = .) %>%
  factor_analysis_results(fa_scores_rotated)

AFIT-R/anomalyDetection documentation built on Oct. 14, 2019, 5:24 p.m.