0% found this document useful (0 votes)
289 views

Package Factoshiny': R Topics Documented

The Factoshiny package allows performing factorial analysis from FactoMineR within a Shiny application. It contains functions to perform CA, PCA, MFA, HCPC and MCA. The user can easily change analysis parameters and graphical parameters to see interactive results. Graphs can be downloaded in different formats. The package was created to perform these analyses simply within a graphical user interface.

Uploaded by

Didi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
289 views

Package Factoshiny': R Topics Documented

The Factoshiny package allows performing factorial analysis from FactoMineR within a Shiny application. It contains functions to perform CA, PCA, MFA, HCPC and MCA. The user can easily change analysis parameters and graphical parameters to see interactive results. Graphs can be downloaded in different formats. The package was created to perform these analyses simply within a graphical user interface.

Uploaded by

Didi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

Package ‘Factoshiny’

February 5, 2020
Type Package
Title Perform Factorial Analysis from 'FactoMineR' with a Shiny
Application
Version 2.2
Date 2020-02-05
Author Pauline Vaissie, Astrid Monge, Francois Husson
Maintainer Francois Husson <[email protected]>
Depends FactoMineR (>= 2.0),shiny,FactoInvestigate (>= 1.5),ggplot2
Imports DT,colourpicker,grDevices,tcltk,ggrepel,shinydashboard,shinyjqui,missMDA
Description Perform factorial analysis with a menu and draw graphs interactively thanks to 'Fac-
toMineR' and a Shiny application.
URL http://factominer.free.fr/graphs/factoshiny.html
License GPL (>= 2)
Encoding latin1
NeedsCompilation no
Repository CRAN
Date/Publication 2020-02-05 15:20:08 UTC

R topics documented:
Factoshiny-package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
CAshiny . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
catdesshiny . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
condesshiny . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
FAMDshiny . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
HCPCshiny . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
MCAshiny . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
MFAshiny . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
PCAshiny . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
print.CAshiny . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
print.FAMDshiny . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

1
2 Factoshiny-package

print.HCPCshiny . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
print.MCAshiny . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
print.MFAshiny . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
print.PCAshiny . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

Index 18

Factoshiny-package Perform classical factorial analysis from FactoMineR within a Shiny


app ~~ Factoshiny ~~

Description
Factoshiny allows to perform CA, PCA, MFA, HCPC and MFA (classical functions from Fac-
toMineR) within a Shiny app. The user can easily change the function parameters and the graphs
parameters and can automatically see the restults of the change on the plot. All graphs can be
downloaded in png, jpg and pdf.

Details

Package: Factoshiny
Type: Package
Version: 1.0
Date: 2015-01-20
License: GPL (>= 2)

Factoshiny have been created to be as easy to use as possible. Thus, only one parameter need to be
informed in the several functions. CAshiny, PCAshiny, MCAshiny and MFAshiny need a dataset to
work. HCPCshiny need the result of a factorial analysis or a dataframe.

Author(s)

Pauline Vaissie, Astrid Monge, Francois Husson


Maintainer: Who to complain to <[email protected]>

References

~~ Literature or other references for background information ~~

See Also

~~ Optional links to other man pages, e.g. ~~


CAshiny 3

CAshiny Correspondance Analysis (CA) with Factoshiny

Description

Performs Correspondance Analysis (CA) including supplementary row and/or column points on a
Shiny application.
Columns or rows with NA are considered as supplementary in the analysis.
Allows to change CA parameters and graphical parmeters.
Graphics can be downloaded in png, jpg and pdf.

Usage

CAshiny(X)

Arguments

X a data frame or a table with n rows and p columns, i.e. a contingency table or a
CAshiny result or a CA result

Value

Returns several tabs:

Graphs a tab containing the row and column points factor map (with supplementary
columns and supplementary rows)
Values a tab containing the summary of the CA performed, the eigenvalues, the results
for the columns, for the rows, for the supplementary columns and for the sup-
plementary rows.
Summary of dataset
a tab containing the summary of the dataset and a boxplot and histogram for
quantitative variables.
Data a tab containing the dataset with a nice display.

The left part of the application allows to change all the elements of the CA and the graphs (axes,variables,colors...)

Author(s)

Pauline Vaissie, Astrid Monge, Francois Husson <[email protected]>

See Also

CA, plot.CA
shiny website
4 catdesshiny

Examples
## Not run:
require(FactoMineR)
data(children)
# Correspondance Analysis with Factoshiny:
res.shiny=CAshiny(children)

# Find your app the way you left it (by clicking on the "Quit the app" button)
res.shiny2=CAshiny(res.shiny)

#CAshiny on a result of a CA
data(children)
res.ca <- CA (children, row.sup = 15:18, col.sup = 6:8)
res.shiny=CAshiny(res.ca)

## End(Not run)

catdesshiny Categories description

Description
Description of the categories of one factor by categorical variables and/or by quantitative variables

Usage
catdesshiny(X)

Arguments
X a data frame made up of at least one categorical variables and a set of quantitative
variables and/or categorical variables

Value
Returns a list including:

test.chi The categorical variables which characterized the factor are listed in ascending
order (from the one which characterized the most the factor to the one which
significantly characterized with the proba proba
category description of each category of the num.var by each category of all the categor-
ical variables
quanti.var the global description of the num.var variable by the quantitative variables with
the square correlation coefficient and the p-value of the F-test in a one-way anal-
ysis of variance (assuming the hypothesis of homoscedsticity)
quanti the description of each category of the num.var variable by the quantitative
variables.
condesshiny 5

Author(s)
Etienne Lancelle, Francois Husson <[email protected]>

References
Husson, F., Le, S. and Pages, J. (2010). Exploratory Multivariate Analysis by Example Using R,
Chapman and Hall. Lebart, L., Morineau, A. and Piron, M. (1995) Statistique exploratoire multi-
dimensionnelle, Dunod.

See Also
catdes

Examples
## Not run:
require(FactoMineR)
data(wine)
catdesshiny(wine)

## End(Not run)

condesshiny Continuous variable description

Description
Description continuous by quantitative variables and/or by categorical variables

Usage
condesshiny(X)

Arguments
X a data frame made up of at least one quantitative variable and a set of quantitative
variables and/or categorical variables

Value
Returns a list including:
quanti the description of the num.var variable by the quantitative variables. The vari-
ables are sorted in ascending order (from the one which characterized the most
to the one which significantly characterized with the proba proba)
quali The categorical variables which characterized the continuous variables are listed
in ascending order
category description of the continuous variable num.var by each category of all the cate-
gorical variables
6 FAMDshiny

Author(s)
Etienne Lancelle, Francois Husson <[email protected]>

See Also
condes

Examples
## Not run:
require(FactoMineR)
data(decathlon)
condesshiny(decathlon)

## End(Not run)

FAMDshiny Factor Analysis for Mixed Data with Factoshiny

Description
Performs Factor Analysis for Mixed Data (FAMD) with supplementary individuals, supplementary
quantitative variables and supplementary categorical variables on a Shiny application.
Allows to change FAMD parameters and graphical parmeters.
Graphics can be downloaded in png, jpg and pdf.

Usage
FAMDshiny(X)

Arguments
X a data frame with n rows (individuals) and p columns (numeric variables and
categorical variables), or a FAMDshiny result or a FAMD result

Value
Returns several tabs:

Graphs a tab containing the individuals factor map, the variables factor (quantitative and
categorical) map and the correlation circle.
Values a tab containing the summary of the FAMD performed, the eigenvalues, the
results for the variables, the results for the individuals, the results for the sup-
plementary variables and the results for the supplementary individuals.
Summary of dataset
a tab containing the summary of the dataset and a boxplot and histogram for
quantitative variables.
HCPCshiny 7

Data a tab containing the dataset with a nice display.

The left part of the application allows to change all the elements of the FAMDA and the graphs
(axes,variables,colors...)

Author(s)
Pauline Vaissie, Astrid Monge, Francois Husson <[email protected]>

See Also
FAMD,plot.FAMD
shiny website

Examples
## Not run:
require(FactoMineR)
data(geomorphology)
# FAMD with Factoshiny:
res.shiny=FAMDshiny(geomorphology)

# Find your app the way you left it (by clicking on the "Quit the app" button)
res.shiny2=FAMDshiny(res.shiny)

## End(Not run)

HCPCshiny Hierarchical Clustering on Principal Components (HCPC) with Fac-


toshiny

Description
Performs Hierarchical Clustering on Principal Components (HCPC) o results from a factor analysis
on a Shiny application.
Allows to change HCPC parameters and graphical parmeters.
Graphics can be downloaded in png, jpg and pdf.

Usage
HCPCshiny(res)

Arguments
res Either the result of a factor analysis or a dataframe, the result of a HCPCshiny
app or an HCPC result
8 HCPCshiny

Value

Returns several tabs:

Graphs a tab containing the factor map,individuals colores by cluster, the 3D map (same
graph but with tree above) and the tree map
Values a tab containing the description of classes (by variables and by axes) and the
parangons of each cluster
Summary of dataset
a tab containing the summary of the dataset and a boxplot and histogram for
quantitative variables.
Data a tab containing the dataset with a nice display.

The left part of the application allows to change the number of cluster very easily. Some parameters
from the graphs can also be changed. By default, the numeric value of the number of clusters is set
to the value advised by the HCPC function.

Author(s)

Pauline Vaissie, Astrid Monge, Francois Husson <[email protected]>

See Also

HCPC, plot.HCPC
shiny website

Examples

## Not run:
require(FactoMineR)
data(decathlon)
# HCPC with Factoshiny on a result of a factor analysis:
res.pca <- PCA(decathlon, quanti.sup = 11:12, quali.sup=13)
res.shiny=HCPCshiny(res.pca)

# HCPC with Factoshiny on a dataframe:


data(wine)
res.shiny2=HCPCshiny(wine)

# Find your app the way you left it (by clicking on the "Quit the app" button)
res.shiny3=HCPCshiny(res.shiny2)

## End(Not run)
MCAshiny 9

MCAshiny Multiple Correspondence Analysis (MCA) with Factoshiny

Description
Performs Multiple Correspondence Analysis (MCA) with supplementary individuals, supplemen-
tary quantitative variables and supplementary categorical variables on a Shiny application.
Allows to change MCA parameters and graphical parmeters.
Graphics can be downloaded in png, jpg and pdf.

Usage
MCAshiny(X)

Arguments
X a data frame with n rows (individuals) and p columns (numeric variables), or a
MCAshiny result or a MCA result

Value
Returns several tabs:

Graphs a tab containing the individuals factor map and the variables factor map.
Values a tab containing the summary of the MCA performed, the eigenvalues, the re-
sults for the variables, the results for the individuals, the results for the supple-
mentary variables and the results for the numerical variables.
Automatic description of axes
a tab containing the output of the dimdesc function. This function is designed
to point out the variables and the categories that are the most characteristic ac-
cording to each dimension obtained by a Factor Analysis.
Summary of dataset
a tab containing the summary of the dataset and a boxplot and histogram for
quantitative variables.
Data a tab containing the dataset with a nice display.

The left part of the application allows to change all the elements of the MCA and the graphs
(axes,variables,colors...)

Author(s)
Pauline Vaissie, Astrid Monge, Francois Husson <[email protected]>

See Also
MCA,dimdesc,plot.MCA
shiny website
10 MFAshiny

Examples
## Not run:
require(FactoMineR)
data(poison)
# Multiple Correspondance Analysis with Factoshiny:
res.shiny=MCAshiny(poison)

# Find your app the way you left it (by clicking on the "Quit the app" button)
res.shiny2=MCAshiny(res.shiny)

#MCAshiny on a result of a MCA


data(hobbies)
res.mca <- MCA(hobbies,quali.sup=19:22,quanti.sup=23)
res.shiny=MCAshiny(res.mca)

## End(Not run)

MFAshiny Multiple Factor Analysis (MFA) with Factoshiny

Description
Performs Multiple Factor Analysis (MFA) with supplementary individuals and supplementary groups
of variables on a Shiny application.
Groups of variables can be quantitative, categorical or contingency tables.
Allows to change MFA parameters and graphical parmeters. A maximum of 10 groups can be cre-
ated
Graphics can be downloaded in png, jpg, pdf and emf.

Usage
MFAshiny(X)

Arguments
X a data frame with n rows (individuals) and p columns or a result of the MFA
function

Value
Returns several tabs:

Graphs a tab containing the individuals factor map, the variables factor map, the groups
factor map, the axes factor map and the frequencies factor map (if there is at
least one frequency group)
Values a tab containing the summary of the MFA performed, the eigenvalues, the results
for the variables, the results for the individuals and the results of the groups
PCAshiny 11

Summary of dataset
a tab containing the summary of the dataset and a boxplot and histogram for
quantitative variables.
Data a tab containing the dataset with a nice display.

Author(s)
Pauline Vaissie, Astrid Monge, Francois Husson <[email protected]>

See Also
PCA, plot.PCA
shiny website

Examples
## Not run:
require(FactoMineR)
data(wine)
# Multiple Factor Analysis with Factoshiny:
res.shiny=MFAshiny(wine)

#If you want to create your groups first and customize your graphs
res.mfa= MFA(wine, group=c(2,5,3,10,9,2), type=c("n",rep("s",5)),
ncp=5, name.group=c("orig","olf","vis","olfag","gust","ens"),
num.group.sup=c(1,6))
res.shiny=MFAshiny(res.mfa)

## End(Not run)

PCAshiny Principal Component Analysis (PCA) with FactoShiny

Description
Performs Principal Component Analysis (PCA) with supplementary individuals, supplementary
quantitative variables and supplementary categorical variables on a Shiny application.
Allows to change PCA parameters and graphical parmeters.
Graphics can be downloaded in png, jpg, pdf and emf.

Usage
PCAshiny(X)

Arguments
X a data frame with n rows (individuals) and p columns (numeric variables) or a
PCAshiny result, or a PCA result
12 PCAshiny

Value

Returns several tabs:

Graphs a tab containing the individuals factor map and the variables factor map.
Values a tab containing the summary of the PCA performed, the eigenvalues, the results
for the variables, the results for the individuals, the results for the supplementary
variables and the results for the categorical variables.
Automatic description of axes
a tab containing the output of the dimdesc function. This function is designed
to point out the variables and the categories that are the most characteristic ac-
cording to each dimension obtained by a Factor Analysis.
Summary of dataset
a tab containing the summary of the dataset and a boxplot and histogram for
quantitative variables.
Data a tab containing the dataset with a nice display.

The left part of the application allows to change all the elements of the PCA and the graphs
(axes,variables,colors...). The "Get your code" button print the PCA and the plots code in your
RStudio session.

Author(s)

Pauline Vaissie, Astrid Monge, Francois Husson <[email protected]>

See Also

PCA, plot.PCA
shiny website

Examples
## Not run:
require(FactoMineR)
data(decathlon)
# Principal Component Analysis with Factoshiny:
res.shiny=PCAshiny(decathlon)

# Find your app the way you left it (by clicking on the "Quit the app" button)
res.shiny2=PCAshiny(res.shiny)

#PCAshiny on a result of a PCA


res.pca <- PCA(decathlon, quanti.sup = 11:12, quali.sup=13)
res.shiny=PCAshiny(res.pca)

## End(Not run)
print.CAshiny 13

print.CAshiny Print the CAshiny results

Description
Print the CAshiny results i.e the R corresponding script

Usage
## S3 method for class 'CAshiny'
print(x,...)

Arguments
x an object of class CAshiny
... further arguments passed to or from other methods

Author(s)
Pauline Vaissie, Astrid Monge, Francois Husson <[email protected]>

See Also
CAshiny

Examples
## Not run:
data(children)
res.shiny = CAshiny(children)
#click on the "Quit the app" button
print(res.shiny)

## End(Not run)

print.FAMDshiny Print the FAMDshiny results

Description
Print the FAMDshiny results i.e the R corresponding script

Usage
## S3 method for class 'FAMDshiny'
print(x,...)
14 print.HCPCshiny

Arguments
x an object of class FAMDshiny
... further arguments passed to or from other methods

Author(s)
Pauline Vaissie, Astrid Monge, Francois Husson <[email protected]>

See Also
FAMDshiny

Examples
## Not run:
data(geomorphology)
res.shiny = FAMDshiny(geomorphology)
#click on the "Quit the app" button
print(res.shiny)

## End(Not run)

print.HCPCshiny Print the HCPCshiny results

Description
Print the HCPCshiny results i.e the R corresponding script

Usage
## S3 method for class 'HCPCshiny'
print(x,...)

Arguments
x an object of class HCPCshiny
... further arguments passed to or from other methods

Author(s)
Pauline Vaissie, Astrid Monge, Francois Husson <[email protected]>

See Also
HCPCshiny
print.MCAshiny 15

Examples
## Not run:
data(decathlon)
res.shiny = HCPCshiny(decathlon)
#click on the "Quit the app" button
print(res.shiny)

## End(Not run)

print.MCAshiny Print the MCAshiny results

Description
Print the MCAshiny results i.e the R corresponding script

Usage
## S3 method for class 'MCAshiny'
print(x,...)

Arguments
x an object of class MCAshiny
... further arguments passed to or from other methods

Author(s)
Pauline Vaissie, Astrid Monge, Francois Husson <[email protected]>

See Also
MCAshiny

Examples
## Not run:
data(poison)
res.shiny = MCAshiny(poison)
#click on the "Quit the app" button
print(res.shiny)

## End(Not run)
16 print.MFAshiny

print.MFAshiny Print the MFAshiny results

Description

Print the MFAshiny results i.e the R corresponding script

Usage

## S3 method for class 'MFAshiny'


print(x,...)

Arguments

x an object of class MFAshiny


... further arguments passed to or from other methods

Author(s)

Pauline Vaissie, Astrid Monge, Francois Husson <[email protected]>

See Also

MFAshiny

Examples

## Not run:
data(wine)
res<- MFA(wine, group=c(2,5,3,10,9,2), type=c("n",rep("s",5)),
ncp=5, name.group=c("orig","olf","vis","olfag","gust","ens"),
num.group.sup=c(1,6),graph=FALSE)
res.shiny=MFAshiny(res)

#click on the "Quit the app" button


print(res.shiny)

## End(Not run)
print.PCAshiny 17

print.PCAshiny Print the PCAshiny results

Description
Print the PCAshiny results i.e the R corresponding script

Usage
## S3 method for class 'PCAshiny'
print(x,...)

Arguments
x an object of class PCAshiny
... further arguments passed to or from other methods

Author(s)
Pauline Vaissie, Astrid Monge, Francois Husson <[email protected]>

See Also
PCAshiny

Examples
## Not run:
data(decathlon)
res.shiny = PCAshiny(decathlon)
#click on the "Quit the app" button
print(res.shiny)

## End(Not run)
Index

∗Topic multivariate print.CAshiny, 13


catdesshiny, 4 print.FAMDshiny, 13
condesshiny, 5 print.HCPCshiny, 14
∗Topic package print.MCAshiny, 15
Factoshiny-package, 2 print.MFAshiny, 16
∗Topic print print.PCAshiny, 17
print.CAshiny, 13
print.FAMDshiny, 13
print.HCPCshiny, 14
print.MCAshiny, 15
print.MFAshiny, 16
print.PCAshiny, 17

CA, 3
CAshiny, 3, 13
catdes, 5
catdesshiny, 4
condes, 6
condesshiny, 5

dimdesc, 9

Factoshiny (Factoshiny-package), 2
Factoshiny-package, 2
FAMD, 7
FAMDshiny, 6, 14

HCPC, 8
HCPCshiny, 7, 14

MCA, 9
MCAshiny, 9, 15
MFAshiny, 10, 16

PCA, 11, 12
PCAshiny, 11, 17
plot.CA, 3
plot.FAMD, 7
plot.HCPC, 8
plot.MCA, 9
plot.PCA, 11, 12

18

You might also like