knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-"
)

FactoHelpeR

Build status Build Status codecov

Project Status: Suspended – Initial development has started, but there has not yet been a stable, usable release; work has been stopped for the time being but the author(s) intend on resuming work. lifecycle

Overview

Extract and visualize FactoMineR results. This package provides several methods for plotting and summarizing results of multivariate exploratory data analysis (e.g. PCA, CA). FactoHelpeR uses ggplot2, this makes it easy to customize plots (e.g. using themes, stat and scales).

This package only supports Principal Component Analysis (PCA) and Correspondence Analysis (CA).

Installation

You can install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("nfrerebeau/FactoHelpeR")

Usage

FactoHelpeR provides a set of S3 methods to explore the results of multivariate data analysis from FactoMineR:

library(FactoHelpeR)
library(FactoMineR)

# PCA
data(decathlon)
results <- FactoMineR::PCA(decathlon, scale.unit = TRUE, quanti.sup = 11:12,
                           quali.sup = 13, graph = FALSE)
# Extract individuals coordinates
ind_coord <- extract(results, "ind coord")
head(ind_coord)
# Summarize results for the first 5 active variables along the first component
(ind <- summarize(results, "var", rows = 1:5, axes = 1))
# Plot individuals
visualize(results, map = "ind", axes = c(1, 2), group = 13) +
  ggplot2::labs(title = "Individuals map") +
  ggplot2::theme_bw()

# Plot variables and supplementary categories
visualize(results, map = "variables", axes = c(1, 2),
          extra = c("quanti", "quali")) +
  ggrepel::geom_label_repel(size = 3, segment.colour = "grey", seed = 123) +
  ggplot2::labs(title = "Variables map") +
  ggplot2::theme_bw()
# Plot eigenvalues and cumulative percentage of variance
visualize(results, map = "eig") +
  ggplot2::theme_bw()


nfrerebeau/FactoHelpeR documentation built on Nov. 5, 2019, 3:16 p.m.