The GABB package is designed to assist casual R users in conducting and synthesizing RDA (Redundancy Analysis) and PCA (Principal Component Analysis) analyses. This encompasses everything from preparing datasets to generating visualizations.

GABB does not attempt to ‘reinvent the wheel.’ It requires main inputs to be RDA and PCA objects, which should be created using the ‘vegan’ and ‘FactoMineR’ packages, respectively.

For RDA, GABB aims to verify data conformity with RDA requirements and to simplify the process of displaying and saving RDA outputs.

For PCA, the package focuses on streamlining and enhancing the graphical representation of PCA, particularly in the projection of individuals and variables.

Graphical outputs are based on the ‘ggplot2’, ‘ggplotify’, ‘ggforce’, and ‘ggpubr’ packages. Plots created with GABB are saved as ‘grob’ or ‘ggplot’ objects, allowing users to further customize them using standard ‘ggplot2’ functions.


You can install the development version of GABB like so:

# install.package("GABB")
# library(GABB)


This is a basic example which shows you how use GABB with the mtcars data.set:


#Example of GABB package pipeline with the base data.set "mtcars" <- mtcars

#Data preparation for RDA and PCA : tranformation and scaling of numeric/quantitative variables

prep_data(data =, quantitative_columns = c(1:7), transform_data_method = "log", scale_data = T)

check_data_for_RDA(data_quant = data_quant,initial_data =,factor_names = c("vs", "am", "gear", "carb"))
# => the data set factor carb not suited for RDA analysis
# Simple solution : not considering it

check_data_for_RDA(data_quant = data_quant,initial_data =,factor_names = c("vs", "am", "gear"))
#Check passed. Go for RDA.

#Performing simple RDA analysis
my.RDA <- vegan::rda(data_quant~vs+am+gear,

#Display and save RDA outputs
#' RDA_outputs_synthesis(RDA = my.RDA, RDA.synth = TRUE, RDA.anova = TRUE, RDA.Table = TRUE)
# => the factor gear is not significant for the model residual variance modulations.
# For the following graphic displays, it will be considered as low importance factor.

#Performing simple PCA analysis
my.PCA <- FactoMineR::PCA(X = data_quant, scale.unit = F, ncp = 5, graph = F) 

#Create, display and save graphics of PCA individual and variable projections.
PCA_RDA_graphics( =, factor.names = c("vs", "am", "gear"), 
                 PCA.object = my.PCA, Dim.a = 1, Dim.b = 2,
                 Barycenter = T, Segments = T, Barycenter.min.size = 2, Ind.min.size = 1,
                 Segment.line.type = 2, Segment.line.size = 0.1,
                 Ellipse.IC.95 = T, Barycenter.Ellipse.Fac1 = "vs", Barycenter.Ellipse.Fac2 = "am",
                 factor.colors = "vs", factor.shapes = "am",
        = T, = 2, Var.label.size = 5,
                 Biplot.PCA = F, width.PCA.ind.graph = 0.6, width.PCA.var.graph = 0.4, 
        = T, = 0.3, = "cor",
        = c(1,2), = T, = T, = T,
                 RDA.table.graph = T,RDA.table.graph.height = 0.3 )