library(readxl)
ref_art <- read_excel("~/ADC/Referencias_Articulos.xlsx")
View(ref_art)

library(FactoMineR)
library(ade4)
## 
## Attaching package: 'ade4'
## The following object is masked from 'package:FactoMineR':
## 
##     reconst
library(FactoClass)
## Loading required package: ggplot2
## Loading required package: ggrepel
## Loading required package: xtable
## Loading required package: scatterplot3d
library(factoextra)
## Welcome! Want to learn more? See two factoextra-related books at https://goo.gl/ve3WBa
library(missMDA)
library(ggplot2)

#############

#####################################

Sev_relativa<-as.numeric(ref_art$Sev_relativa)
Gen<-as.factor(ref_art$Gen)
Temp<-as.numeric(ref_art$Temp)
Pais<-as.factor(ref_art$Pais)
Genotipo<-as.factor(ref_art$Genotipo)
Cromosoma<-as.numeric(ref_art$Cromosoma)

t<-data.frame(Gen, Pais, Genotipo, Cromosoma, Sev_relativa, Temp)
View(t)
r_mca <- MCA(t,quanti.sup=c(4:6))

summary(r_mca, ncp=3, nbelements=Inf)
## 
## Call:
## MCA(X = t, quanti.sup = c(4:6)) 
## 
## 
## Eigenvalues
##                        Dim.1   Dim.2   Dim.3   Dim.4   Dim.5   Dim.6   Dim.7
## Variance               0.966   0.774   0.702   0.667   0.667   0.667   0.667
## % of var.              5.366   4.300   3.902   3.704   3.704   3.704   3.704
## Cumulative % of var.   5.366   9.666  13.568  17.272  20.975  24.679  28.383
##                        Dim.8   Dim.9  Dim.10  Dim.11  Dim.12  Dim.13  Dim.14
## Variance               0.667   0.667   0.616   0.544   0.528   0.526   0.526
## % of var.              3.704   3.704   3.424   3.022   2.933   2.921   2.921
## Cumulative % of var.  32.086  35.790  39.214  42.236  45.170  48.091  51.012
##                       Dim.15  Dim.16  Dim.17  Dim.18  Dim.19  Dim.20  Dim.21
## Variance               0.514   0.500   0.490   0.482   0.482   0.480   0.477
## % of var.              2.858   2.778   2.721   2.680   2.680   2.665   2.647
## Cumulative % of var.  53.870  56.647  59.369  62.049  64.729  67.394  70.041
##                       Dim.22  Dim.23  Dim.24  Dim.25  Dim.26  Dim.27  Dim.28
## Variance               0.459   0.356   0.333   0.333   0.333   0.333   0.333
## % of var.              2.552   1.978   1.852   1.852   1.852   1.852   1.852
## Cumulative % of var.  72.593  74.571  76.423  78.275  80.127  81.979  83.831
##                       Dim.29  Dim.30  Dim.31  Dim.32  Dim.33  Dim.34  Dim.35
## Variance               0.333   0.333   0.333   0.207   0.184   0.184   0.175
## % of var.              1.852   1.852   1.852   1.152   1.024   1.024   0.972
## Cumulative % of var.  85.682  87.534  89.386  90.538  91.562  92.585  93.557
##                       Dim.36  Dim.37  Dim.38  Dim.39  Dim.40  Dim.41  Dim.42
## Variance               0.167   0.166   0.159   0.141   0.141   0.141   0.127
## % of var.              0.926   0.923   0.882   0.785   0.783   0.783   0.708
## Cumulative % of var.  94.483  95.407  96.288  97.074  97.856  98.639  99.347
##                       Dim.43  Dim.44  Dim.45  Dim.46  Dim.47  Dim.48  Dim.49
## Variance               0.064   0.053   0.000   0.000   0.000   0.000   0.000
## % of var.              0.357   0.296   0.000   0.000   0.000   0.000   0.000
## Cumulative % of var.  99.704 100.000 100.000 100.000 100.000 100.000 100.000
##                       Dim.50  Dim.51  Dim.52  Dim.53  Dim.54
## Variance               0.000   0.000   0.000   0.000   0.000
## % of var.              0.000   0.000   0.000   0.000   0.000
## Cumulative % of var. 100.000 100.000 100.000 100.000 100.000
## 
## Individuals
##                                Dim.1    ctr   cos2    Dim.2    ctr   cos2  
## 1                           | -0.559  0.395  0.062 |  0.002  0.000  0.000 |
## 2                           | -0.542  0.371  0.052 |  0.022  0.001  0.000 |
## 3                           | -0.542  0.371  0.052 |  0.022  0.001  0.000 |
## 4                           | -0.542  0.371  0.052 |  0.022  0.001  0.000 |
## 5                           | -0.643  0.522  0.063 | -0.059  0.006  0.001 |
## 6                           | -0.644  0.524  0.052 | -0.063  0.006  0.000 |
## 7                           | -0.643  0.522  0.063 | -0.059  0.006  0.001 |
## 8                           | -0.643  0.522  0.063 | -0.059  0.006  0.001 |
## 9                           | -0.644  0.524  0.052 | -0.063  0.006  0.000 |
## 10                          | -0.646  0.527  0.083 | -0.071  0.008  0.001 |
## 11                          | -0.646  0.527  0.083 | -0.071  0.008  0.001 |
## 12                          | -0.557  0.391  0.060 |  0.005  0.000  0.000 |
## 13                          | -0.539  0.367  0.050 |  0.025  0.001  0.000 |
## 14                          | -0.539  0.367  0.050 |  0.025  0.001  0.000 |
## 15                          | -0.539  0.367  0.050 |  0.025  0.001  0.000 |
## 16                          | -0.641  0.518  0.061 | -0.056  0.005  0.000 |
## 17                          | -0.642  0.520  0.051 | -0.060  0.006  0.000 |
## 18                          | -0.641  0.518  0.061 | -0.056  0.005  0.000 |
## 19                          | -0.641  0.518  0.061 | -0.056  0.005  0.000 |
## 20                          | -0.642  0.520  0.051 | -0.060  0.006  0.000 |
## 21                          | -0.643  0.523  0.080 | -0.068  0.007  0.001 |
## 22                          | -0.643  0.523  0.080 | -0.068  0.007  0.001 |
## 23                          | -0.557  0.391  0.060 |  0.005  0.000  0.000 |
## 24                          | -0.539  0.367  0.050 |  0.025  0.001  0.000 |
## 25                          | -0.539  0.367  0.050 |  0.025  0.001  0.000 |
## 26                          | -0.539  0.367  0.050 |  0.025  0.001  0.000 |
## 27                          | -0.641  0.518  0.061 | -0.056  0.005  0.000 |
## 28                          | -0.641  0.518  0.061 | -0.056  0.005  0.000 |
## 29                          | -0.641  0.518  0.061 | -0.056  0.005  0.000 |
## 30                          | -0.643  0.523  0.080 | -0.068  0.007  0.001 |
## 31                          | -0.643  0.523  0.080 | -0.068  0.007  0.001 |
## 32                          | -0.535  0.361  0.009 |  0.026  0.001  0.000 |
## 33                          | -0.509  0.327  0.008 |  0.062  0.006  0.000 |
## 34                          | -0.509  0.327  0.008 |  0.062  0.006  0.000 |
## 35                          | -0.509  0.327  0.008 |  0.062  0.006  0.000 |
## 36                          | -0.663  0.555  0.013 | -0.081  0.010  0.000 |
## 37                          | -0.665  0.558  0.013 | -0.087  0.012  0.000 |
## 38                          | -0.663  0.555  0.013 | -0.081  0.010  0.000 |
## 39                          | -0.663  0.555  0.013 | -0.081  0.010  0.000 |
## 40                          | -0.665  0.558  0.013 | -0.087  0.012  0.000 |
## 41                          | -0.668  0.563  0.014 | -0.102  0.016  0.000 |
## 42                          | -0.668  0.563  0.014 | -0.102  0.016  0.000 |
## 43                          | -0.573  0.414  0.046 | -0.044  0.003  0.000 |
## 44                          | -0.556  0.390  0.040 | -0.023  0.001  0.000 |
## 45                          | -0.556  0.390  0.040 | -0.023  0.001  0.000 |
## 46                          | -0.556  0.390  0.040 | -0.023  0.001  0.000 |
## 47                          | -0.657  0.545  0.050 | -0.105  0.017  0.001 |
## 48                          | -0.658  0.547  0.043 | -0.108  0.018  0.001 |
## 49                          | -0.657  0.545  0.050 | -0.105  0.017  0.001 |
## 50                          | -0.657  0.545  0.050 | -0.105  0.017  0.001 |
## 51                          | -0.658  0.547  0.043 | -0.108  0.018  0.001 |
## 52                          | -0.660  0.549  0.061 | -0.117  0.021  0.002 |
## 53                          | -0.660  0.549  0.061 | -0.117  0.021  0.002 |
## 54                          | -0.670  0.567  0.045 | -0.134  0.028  0.002 |
## 55                          | -0.670  0.567  0.045 | -0.134  0.028  0.002 |
## 56                          |  1.847  4.306  0.212 | -1.959  6.046  0.239 |
## 57                          |  1.929  4.700  0.149 | -3.307 17.235  0.438 |
## 58                          |  1.847  4.306  0.212 | -1.959  6.046  0.239 |
## 59                          |  1.929  4.700  0.149 | -3.307 17.235  0.438 |
## 60                          |  1.679  3.558  0.265 | -0.537  0.455  0.027 |
## 61                          |  1.679  3.558  0.265 | -0.537  0.455  0.027 |
## 62                          | -0.583  0.430  0.034 | -0.061  0.006  0.000 |
## 63                          | -0.670  0.567  0.045 | -0.134  0.028  0.002 |
## 64                          | -0.670  0.567  0.045 | -0.134  0.028  0.002 |
## 65                          |  1.666  3.504  0.142 | -0.636  0.637  0.021 |
## 66                          |  1.641  3.400  0.154 | -0.174  0.048  0.002 |
## 67                          |  1.666  3.504  0.142 | -0.636  0.637  0.021 |
## 68                          |  1.641  3.400  0.154 | -0.174  0.048  0.002 |
## 69                          |  1.634  3.372  0.086 |  0.001  0.000  0.000 |
## 70                          |  0.525  0.347  0.009 |  0.558  0.491  0.010 |
## 71                          |  0.551  0.383  0.009 |  0.594  0.556  0.011 |
## 72                          |  0.551  0.383  0.009 |  0.594  0.556  0.011 |
## 73                          |  0.551  0.383  0.009 |  0.594  0.556  0.011 |
## 74                          |  1.561  3.076  0.044 |  2.075  6.783  0.078 |
## 75                          |  1.561  3.076  0.044 |  2.075  6.783  0.078 |
## 76                          |  1.561  3.076  0.044 |  2.075  6.783  0.078 |
## 77                          |  1.634  3.372  0.086 |  0.001  0.000  0.000 |
## 78                          |  1.561  3.076  0.044 |  2.075  6.783  0.078 |
## 79                          |  1.561  3.076  0.044 |  2.075  6.783  0.078 |
## 80                          |  1.561  3.076  0.044 |  2.075  6.783  0.078 |
## 81                          |  1.672  3.532  0.084 | -0.810  1.034  0.020 |
## 82                          |  1.561  3.076  0.044 |  2.075  6.783  0.078 |
##                              Dim.3    ctr   cos2  
## 1                            0.417  0.302  0.035 |
## 2                            0.730  0.925  0.094 |
## 3                            0.730  0.925  0.094 |
## 4                            0.730  0.925  0.094 |
## 5                            0.740  0.951  0.083 |
## 6                            0.641  0.714  0.052 |
## 7                            0.740  0.951  0.083 |
## 8                            0.740  0.951  0.083 |
## 9                            0.641  0.714  0.052 |
## 10                           0.193  0.065  0.007 |
## 11                           0.193  0.065  0.007 |
## 12                           0.409  0.290  0.032 |
## 13                           0.722  0.905  0.090 |
## 14                           0.722  0.905  0.090 |
## 15                           0.722  0.905  0.090 |
## 16                           0.732  0.930  0.080 |
## 17                           0.633  0.696  0.050 |
## 18                           0.732  0.930  0.080 |
## 19                           0.732  0.930  0.080 |
## 20                           0.633  0.696  0.050 |
## 21                           0.185  0.060  0.007 |
## 22                           0.185  0.060  0.007 |
## 23                           0.409  0.290  0.032 |
## 24                           0.722  0.905  0.090 |
## 25                           0.722  0.905  0.090 |
## 26                           0.722  0.905  0.090 |
## 27                           0.732  0.930  0.080 |
## 28                           0.732  0.930  0.080 |
## 29                           0.732  0.930  0.080 |
## 30                           0.185  0.060  0.007 |
## 31                           0.185  0.060  0.007 |
## 32                           0.268  0.124  0.002 |
## 33                           0.863  1.294  0.023 |
## 34                           0.863  1.294  0.023 |
## 35                           0.863  1.294  0.023 |
## 36                           0.883  1.353  0.024 |
## 37                           0.694  0.837  0.014 |
## 38                           0.883  1.353  0.024 |
## 39                           0.883  1.353  0.024 |
## 40                           0.694  0.837  0.014 |
## 41                          -0.158  0.043  0.001 |
## 42                          -0.158  0.043  0.001 |
## 43                          -1.494  3.876  0.314 |
## 44                          -1.181  2.422  0.180 |
## 45                          -1.181  2.422  0.180 |
## 46                          -1.181  2.422  0.180 |
## 47                          -1.171  2.380  0.158 |
## 48                          -1.270  2.799  0.161 |
## 49                          -1.171  2.380  0.158 |
## 50                          -1.171  2.380  0.158 |
## 51                          -1.270  2.799  0.161 |
## 52                          -1.718  5.122  0.416 |
## 53                          -1.718  5.122  0.416 |
## 54                          -2.036  7.197  0.411 |
## 55                          -2.036  7.197  0.411 |
## 56                           0.016  0.000  0.000 |
## 57                           0.049  0.004  0.000 |
## 58                           0.016  0.000  0.000 |
## 59                           0.049  0.004  0.000 |
## 60                          -0.006  0.000  0.000 |
## 61                          -0.006  0.000  0.000 |
## 62                          -1.812  5.703  0.326 |
## 63                          -2.036  7.197  0.411 |
## 64                          -2.036  7.197  0.411 |
## 65                           0.002  0.000  0.000 |
## 66                          -0.010  0.000  0.000 |
## 67                           0.002  0.000  0.000 |
## 68                          -0.010  0.000  0.000 |
## 69                          -0.016  0.000  0.000 |
## 70                          -0.281  0.137  0.003 |
## 71                           0.315  0.172  0.003 |
## 72                           0.315  0.172  0.003 |
## 73                           0.315  0.172  0.003 |
## 74                          -0.126  0.027  0.000 |
## 75                          -0.126  0.027  0.000 |
## 76                          -0.126  0.027  0.000 |
## 77                          -0.016  0.000  0.000 |
## 78                          -0.126  0.027  0.000 |
## 79                          -0.126  0.027  0.000 |
## 80                          -0.126  0.027  0.000 |
## 81                           0.008  0.000  0.000 |
## 82                          -0.126  0.027  0.000 |
## 
## Categories
##                                Dim.1    ctr   cos2 v.test    Dim.2    ctr
## R1                          | -0.413  0.502  0.016 -1.135 |  0.080  0.023
## R10                         | -0.669  1.318  0.042 -1.839 | -0.113  0.047
## R11                         | -0.669  1.318  0.042 -1.839 | -0.113  0.047
## R2                          | -0.362  0.331  0.010 -0.915 |  0.134  0.056
## R3                          | -0.362  0.331  0.010 -0.915 |  0.134  0.056
## R3a                         |  1.588  1.062  0.031  1.588 |  2.358  2.921
## R3b                         |  1.588  1.062  0.031  1.588 |  2.358  2.921
## R4                          | -0.362  0.331  0.010 -0.915 |  0.134  0.056
## R5                          | -0.660  0.917  0.028 -1.514 | -0.081  0.017
## R6                          | -0.664  0.741  0.023 -1.352 | -0.090  0.017
## R7                          | -0.660  0.917  0.028 -1.514 | -0.081  0.017
## R8                          | -0.660  0.917  0.028 -1.514 | -0.081  0.017
## R9                          | -0.664  0.741  0.023 -1.352 | -0.090  0.017
## Rpi-blb1                    |  1.588  1.062  0.031  1.588 |  2.358  2.921
## Rpi-blb2                    |  1.588  1.062  0.031  1.588 |  2.358  2.921
## Rpi-blb3                    |  1.588  1.062  0.031  1.588 |  2.358  2.921
## Rpi-chc1                    |  1.588  1.062  0.031  1.588 |  2.358  2.921
## Rpi-pta1                    |  1.588  1.062  0.031  1.588 |  2.358  2.921
## Rpi-sto1                    |  1.730 10.077  0.324  5.119 | -0.759  2.418
## Rpi-vnt1.1                  |  1.804  6.846  0.211  4.136 | -1.977 10.263
## Bélgica                     |  1.921  6.214  0.189  3.915 | -2.993 18.818
## Brasil                      | -0.613  3.164  0.121 -3.134 | -0.032  0.011
## China                       | -0.620  3.561  0.141 -3.380 | -0.041  0.019
## Escocia                     | -0.664  0.929  0.029 -1.523 | -0.135  0.048
## Países Bajos                |  1.425 17.102  0.655  7.286 |  0.759  6.058
## Polonia                     | -0.633  1.856  0.062 -2.243 | -0.091  0.048
## A01-20                      |  1.588  1.062  0.031  1.588 |  2.358  2.921
## A02-33                      |  1.588  1.062  0.031  1.588 |  2.358  2.921
## A03-142                     |  1.588  1.062  0.031  1.588 |  2.358  2.921
## A04-33                      |  1.588  1.062  0.031  1.588 |  2.358  2.921
## A09                         |  1.794  5.416  0.165  3.656 | -1.419  4.227
## A09-277                     |  1.663  1.164  0.034  1.663 |  0.001  0.000
## A13-13                      |  1.702  1.219  0.036  1.702 | -0.921  0.445
## A15                         |  1.963  3.244  0.096  2.794 | -3.759 14.845
## A17-27                      |  1.588  1.062  0.031  1.588 |  2.358  2.921
## A23-43                      |  1.588  1.062  0.031  1.588 |  2.358  2.921
## A25-11                      |  1.588  1.062  0.031  1.588 |  2.358  2.921
## Atlantic                    |  1.682  2.383  0.071  2.394 | -0.460  0.222
## Bintje                      |  1.682  2.383  0.071  2.394 | -0.460  0.222
## Black                       | -0.643  2.783  0.100 -2.849 | -0.105  0.092
## Black 2182ef(7); CIP 800992 | -0.675  0.192  0.006 -0.675 | -0.092  0.004
## Black 2424a(5); CIP 800993  | -0.675  0.192  0.006 -0.675 | -0.092  0.004
## Black 2573; CIP 800994      | -0.677  0.193  0.006 -0.677 | -0.099  0.005
## Black 3053-18;CIP800990     | -0.675  0.192  0.006 -0.675 | -0.092  0.004
## Black 3618ad(1); CIP 800995 | -0.679  0.194  0.006 -0.679 | -0.116  0.007
## Black 5008ab(6); CIP 800996 | -0.679  0.194  0.006 -0.679 | -0.116  0.007
## Black XD2-21; CIP 800991    | -0.677  0.193  0.006 -0.677 | -0.099  0.005
## CEBECO-43154-5;CIP800986    | -0.544  0.125  0.004 -0.544 |  0.029  0.000
## CEBECO-44158-4;CIP800987    | -0.518  0.113  0.003 -0.518 |  0.070  0.003
## CEBECO-4431-5;CIP800989     | -0.518  0.113  0.003 -0.518 |  0.070  0.003
## CEBECO-4642-1;CIP800988     | -0.518  0.113  0.003 -0.518 |  0.070  0.003
## MaR1: CEBECO 43154-5        |  0.534  0.120  0.004  0.534 |  0.635  0.212
## MaR2: CEBECO 44158-4        |  0.560  0.132  0.004  0.560 |  0.675  0.240
## MaR3: CEBECO 4642-1         |  0.560  0.132  0.004  0.560 |  0.675  0.240
## MaR4: CEBECO 4431-5         |  0.560  0.132  0.004  0.560 |  0.675  0.240
## Potae9                      |  1.663  1.164  0.034  1.663 |  0.001  0.000
## Solanum demissum            | -0.615  4.938  0.230 -4.317 | -0.035  0.020
##                               cos2 v.test    Dim.3    ctr   cos2 v.test  
## R1                           0.001  0.219 | -0.356  0.512  0.012 -0.978 |
## R10                          0.001 -0.309 | -0.918  3.412  0.079 -2.523 |
## R11                          0.001 -0.309 | -0.918  3.412  0.079 -2.523 |
## R2                           0.001  0.338 |  0.432  0.647  0.015  1.091 |
## R3                           0.001  0.338 |  0.432  0.647  0.015  1.091 |
## R3a                          0.069  2.358 | -0.150  0.013  0.000 -0.150 |
## R3b                          0.069  2.358 | -0.150  0.013  0.000 -0.150 |
## R4                           0.001  0.338 |  0.432  0.647  0.015  1.091 |
## R5                           0.000 -0.187 |  0.457  0.605  0.014  1.049 |
## R6                           0.000 -0.184 |  0.208  0.101  0.002  0.425 |
## R7                           0.000 -0.187 |  0.457  0.605  0.014  1.049 |
## R8                           0.000 -0.187 |  0.457  0.605  0.014  1.049 |
## R9                           0.000 -0.184 |  0.208  0.101  0.002  0.425 |
## Rpi-blb1                     0.069  2.358 | -0.150  0.013  0.000 -0.150 |
## Rpi-blb2                     0.069  2.358 | -0.150  0.013  0.000 -0.150 |
## Rpi-blb3                     0.069  2.358 | -0.150  0.013  0.000 -0.150 |
## Rpi-chc1                     0.069  2.358 | -0.150  0.013  0.000 -0.150 |
## Rpi-pta1                     0.069  2.358 | -0.150  0.013  0.000 -0.150 |
## Rpi-sto1                     0.062 -2.245 | -0.005  0.000  0.000 -0.015 |
## Rpi-vnt1.1                   0.254 -4.534 |  0.026  0.002  0.000  0.060 |
## Bélgica                      0.459 -6.100 |  0.039  0.003  0.000  0.079 |
## Brasil                       0.000 -0.164 |  0.689  5.493  0.153  3.521 |
## China                        0.001 -0.222 |  0.709  6.401  0.184  3.864 |
## Escocia                      0.001 -0.310 | -2.376 16.335  0.367 -5.449 |
## Países Bajos                 0.186  3.882 | -0.016  0.003  0.000 -0.082 |
## Polonia                      0.001 -0.322 | -1.575 15.800  0.385 -5.581 |
## A01-20                       0.069  2.358 | -0.150  0.013  0.000 -0.150 |
## A02-33                       0.069  2.358 | -0.150  0.013  0.000 -0.150 |
## A03-142                      0.069  2.358 | -0.150  0.013  0.000 -0.150 |
## A04-33                       0.069  2.358 | -0.150  0.013  0.000 -0.150 |
## A09                          0.103 -2.891 |  0.006  0.000  0.000  0.011 |
## A09-277                      0.000  0.001 | -0.019  0.000  0.000 -0.019 |
## A13-13                       0.010 -0.921 |  0.009  0.000  0.000  0.009 |
## A15                          0.353 -5.350 |  0.059  0.004  0.000  0.083 |
## A17-27                       0.069  2.358 | -0.150  0.013  0.000 -0.150 |
## A23-43                       0.069  2.358 | -0.150  0.013  0.000 -0.150 |
## A25-11                       0.069  2.358 | -0.150  0.013  0.000 -0.150 |
## Atlantic                     0.005 -0.655 | -0.005  0.000  0.000 -0.007 |
## Bintje                       0.005 -0.655 | -0.005  0.000  0.000 -0.007 |
## Black                        0.003 -0.464 | -1.826 30.860  0.808 -8.090 |
## Black 2182ef(7); CIP 800992  0.000 -0.092 |  1.053  0.642  0.014  1.053 |
## Black 2424a(5); CIP 800993   0.000 -0.092 |  1.053  0.642  0.014  1.053 |
## Black 2573; CIP 800994       0.000 -0.099 |  0.829  0.397  0.008  0.829 |
## Black 3053-18;CIP800990      0.000 -0.092 |  1.053  0.642  0.014  1.053 |
## Black 3618ad(1); CIP 800995  0.000 -0.116 | -0.188  0.021  0.000 -0.188 |
## Black 5008ab(6); CIP 800996  0.000 -0.116 | -0.188  0.021  0.000 -0.188 |
## Black XD2-21; CIP 800991     0.000 -0.099 |  0.829  0.397  0.008  0.829 |
## CEBECO-43154-5;CIP800986     0.000  0.029 |  0.319  0.059  0.001  0.319 |
## CEBECO-44158-4;CIP800987     0.000  0.070 |  1.030  0.614  0.013  1.030 |
## CEBECO-4431-5;CIP800989      0.000  0.070 |  1.030  0.614  0.013  1.030 |
## CEBECO-4642-1;CIP800988      0.000  0.070 |  1.030  0.614  0.013  1.030 |
## MaR1: CEBECO 43154-5         0.005  0.635 | -0.336  0.065  0.001 -0.336 |
## MaR2: CEBECO 44158-4         0.006  0.675 |  0.375  0.081  0.002  0.375 |
## MaR3: CEBECO 4642-1          0.006  0.675 |  0.375  0.081  0.002  0.375 |
## MaR4: CEBECO 4431-5          0.006  0.675 |  0.375  0.081  0.002  0.375 |
## Potae9                       0.000  0.001 | -0.019  0.000  0.000 -0.019 |
## Solanum demissum             0.001 -0.243 |  0.694  8.651  0.293  4.873 |
## 
## Categorical variables (eta2)
##                               Dim.1 Dim.2 Dim.3  
## Gen                         | 0.948 0.778 0.240 |
## Pais                        | 0.951 0.581 0.928 |
## Genotipo                    | 0.998 0.964 0.939 |
## 
## Supplementary continuous variables
##                                Dim.1    Dim.2    Dim.3  
## Cromosoma                   | -0.257 | -0.078 | -0.003 |
## Sev_relativa                | -0.478 |  0.222 | -0.260 |
## Temp                        | -0.296 |  0.021 |  0.458 |
dimdesc(r_mca)
## $`Dim 1`
## $quanti
##              correlation      p.value
## Cromosoma     -0.2570890 1.971976e-02
## Temp          -0.2964603 6.842087e-03
## Sev_relativa  -0.4781230 5.549937e-06
## 
## $quali
##                 R2      p.value
## Genotipo 0.9983032 4.156132e-61
## Pais     0.9510818 2.723682e-48
## Gen      0.9480080 1.321024e-32
## 
## $category
##                             Estimate      p.value
## Pais=Países Bajos          1.2671220 3.417011e-20
## Gen=Rpi-sto1               1.2820507 2.472889e-08
## Gen=Rpi-vnt1.1             1.3544474 1.401206e-05
## Pais=Bélgica               1.7543824 4.417644e-05
## Genotipo=A09               1.2113535 1.529742e-04
## Genotipo=A15               1.3779120 4.539176e-03
## Genotipo=Bintje            1.1020288 1.571336e-02
## Genotipo=Atlantic          1.1020288 1.571336e-02
## Pais=Polonia              -0.7558807 2.394752e-02
## Genotipo=Black            -1.1831386 3.763649e-03
## Pais=Brasil               -0.7360911 1.348244e-03
## Pais=China                -0.7430877 5.079578e-04
## Genotipo=Solanum demissum -1.1559197 5.131492e-06
## 
## attr(,"class")
## [1] "condes" "list"  
## 
## $`Dim 2`
## $quanti
##              correlation    p.value
## Sev_relativa   0.2218534 0.04515974
## 
## $quali
##                 R2      p.value
## Genotipo 0.9635949 2.321139e-27
## Gen      0.7778697 9.311604e-14
## Pais     0.5805449 3.862879e-13
## 
## $category
##                    Estimate      p.value
## Pais=Países Bajos  1.039460 5.221175e-05
## Genotipo=A04-33    1.747174 1.739982e-02
## Gen=R3a            1.476405 1.739982e-02
## Genotipo=A02-33    1.747174 1.739982e-02
## Gen=Rpi-blb2       1.476405 1.739982e-02
## Genotipo=A25-11    1.747174 1.739982e-02
## Genotipo=A17-27    1.747174 1.739982e-02
## Gen=Rpi-chc1       1.476405 1.739982e-02
## Gen=R3b            1.476405 1.739982e-02
## Genotipo=A23-43    1.747174 1.739982e-02
## Gen=Rpi-pta1       1.476405 1.739982e-02
## Genotipo=A03-142   1.747174 1.739982e-02
## Gen=Rpi-blb3       1.476405 1.739982e-02
## Genotipo=A01-20    1.747174 1.739982e-02
## Gen=Rpi-blb1       1.476405 1.739982e-02
## Gen=Rpi-sto1      -1.265784 2.383717e-02
## Genotipo=A09      -1.575651 3.253486e-03
## Gen=Rpi-vnt1.1    -2.337672 1.402629e-06
## Genotipo=A15      -3.635020 3.920839e-09
## Pais=Bélgica      -2.261774 2.678217e-12
## 
## attr(,"class")
## [1] "condes" "list"  
## 
## $`Dim 3`
## $quanti
##              correlation      p.value
## Temp           0.4580641 1.510083e-05
## Sev_relativa  -0.2595649 1.852812e-02
## 
## $quali
##                 R2      p.value
## Pais     0.9279547 6.437428e-42
## Genotipo 0.9394268 7.178640e-22
## 
## $category
##                             Estimate      p.value
## Genotipo=Solanum demissum  0.4066636 1.504178e-07
## Pais=China                 0.9478027 5.696649e-05
## Pais=Brasil                0.9309103 2.783069e-04
## Gen=R10                   -0.7635350 1.073076e-02
## Gen=R11                   -0.7635350 1.073076e-02
## Pais=Escocia              -1.6378057 1.682434e-09
## Pais=Polonia              -0.9668700 5.203866e-10
## Genotipo=Black            -1.7054259 2.130520e-30
## 
## attr(,"class")
## [1] "condes" "list"  
## 
## $call
## $call$num.var
## [1] 1
## 
## $call$proba
## [1] 0.05
## 
## $call$weights
##  [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
## [39] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
## [77] 1 1 1 1 1 1
## 
## $call$X
##         Dim 1            Gen              Pais
## 1  -0.5589812         Gen=R1        Pais=China
## 2  -0.5417682         Gen=R2        Pais=China
## 3  -0.5417682         Gen=R3        Pais=China
## 4  -0.5417682         Gen=R4        Pais=China
## 5  -0.6429357         Gen=R5        Pais=China
## 6  -0.6441042         Gen=R6        Pais=China
## 7  -0.6429357         Gen=R7        Pais=China
## 8  -0.6429357         Gen=R8        Pais=China
## 9  -0.6441042         Gen=R9        Pais=China
## 10 -0.6458399        Gen=R10        Pais=China
## 11 -0.6458399        Gen=R11        Pais=China
## 12 -0.5565664         Gen=R1       Pais=Brasil
## 13 -0.5393534         Gen=R2       Pais=Brasil
## 14 -0.5393534         Gen=R3       Pais=Brasil
## 15 -0.5393534         Gen=R4       Pais=Brasil
## 16 -0.6405209         Gen=R5       Pais=Brasil
## 17 -0.6416894         Gen=R6       Pais=Brasil
## 18 -0.6405209         Gen=R7       Pais=Brasil
## 19 -0.6405209         Gen=R8       Pais=Brasil
## 20 -0.6416894         Gen=R9       Pais=Brasil
## 21 -0.6434251        Gen=R10       Pais=Brasil
## 22 -0.6434251        Gen=R11       Pais=Brasil
## 23 -0.5565664         Gen=R1       Pais=Brasil
## 24 -0.5393534         Gen=R2       Pais=Brasil
## 25 -0.5393534         Gen=R3       Pais=Brasil
## 26 -0.5393534         Gen=R4       Pais=Brasil
## 27 -0.6405209         Gen=R5       Pais=Brasil
## 28 -0.6405209         Gen=R7       Pais=Brasil
## 29 -0.6405209         Gen=R8       Pais=Brasil
## 30 -0.6434251        Gen=R10       Pais=Brasil
## 31 -0.6434251        Gen=R11       Pais=Brasil
## 32 -0.5349411         Gen=R1        Pais=China
## 33 -0.5086561         Gen=R2        Pais=China
## 34 -0.5086561         Gen=R3        Pais=China
## 35 -0.5086561         Gen=R4        Pais=China
## 36 -0.6631429         Gen=R5        Pais=China
## 37 -0.6649271         Gen=R6        Pais=China
## 38 -0.6631429         Gen=R7        Pais=China
## 39 -0.6631429         Gen=R8        Pais=China
## 40 -0.6649271         Gen=R9        Pais=China
## 41 -0.6675777        Gen=R10        Pais=China
## 42 -0.6675777        Gen=R11        Pais=China
## 43 -0.5727908         Gen=R1      Pais=Polonia
## 44 -0.5555778         Gen=R2      Pais=Polonia
## 45 -0.5555778         Gen=R3      Pais=Polonia
## 46 -0.5555778         Gen=R4      Pais=Polonia
## 47 -0.6567453         Gen=R5      Pais=Polonia
## 48 -0.6579138         Gen=R6      Pais=Polonia
## 49 -0.6567453         Gen=R7      Pais=Polonia
## 50 -0.6567453         Gen=R8      Pais=Polonia
## 51 -0.6579138         Gen=R9      Pais=Polonia
## 52 -0.6596495        Gen=R10      Pais=Polonia
## 53 -0.6596495        Gen=R11      Pais=Polonia
## 54 -0.6701984        Gen=R10      Pais=Escocia
## 55 -0.6701984        Gen=R11      Pais=Escocia
## 56  1.8467643   Gen=Rpi-sto1      Pais=Bélgica
## 57  1.9292368 Gen=Rpi-vnt1.1      Pais=Bélgica
## 58  1.8467643   Gen=Rpi-sto1      Pais=Bélgica
## 59  1.9292368 Gen=Rpi-vnt1.1      Pais=Bélgica
## 60  1.6785923   Gen=Rpi-sto1 Pais=Países Bajos
## 61  1.6785923   Gen=Rpi-sto1 Pais=Países Bajos
## 62 -0.5833397         Gen=R1      Pais=Escocia
## 63 -0.6701984        Gen=R10      Pais=Escocia
## 64 -0.6701984        Gen=R11      Pais=Escocia
## 65  1.6658471 Gen=Rpi-vnt1.1 Pais=Países Bajos
## 66  1.6408603   Gen=Rpi-sto1 Pais=Países Bajos
## 67  1.6658471 Gen=Rpi-vnt1.1 Pais=Países Bajos
## 68  1.6408603   Gen=Rpi-sto1 Pais=Países Bajos
## 69  1.6342757   Gen=Rpi-sto1 Pais=Países Bajos
## 70  0.5245177         Gen=R1 Pais=Países Bajos
## 71  0.5508027         Gen=R2 Pais=Países Bajos
## 72  0.5508027         Gen=R3 Pais=Países Bajos
## 73  0.5508027         Gen=R4 Pais=Países Bajos
## 74  1.5608994   Gen=Rpi-blb3 Pais=Países Bajos
## 75  1.5608994        Gen=R3a Pais=Países Bajos
## 76  1.5608994        Gen=R3b Pais=Países Bajos
## 77  1.6342757   Gen=Rpi-sto1 Pais=Países Bajos
## 78  1.5608994   Gen=Rpi-blb1 Pais=Países Bajos
## 79  1.5608994   Gen=Rpi-pta1 Pais=Países Bajos
## 80  1.5608994   Gen=Rpi-blb2 Pais=Países Bajos
## 81  1.6724316 Gen=Rpi-vnt1.1 Pais=Países Bajos
## 82  1.5608994   Gen=Rpi-chc1 Pais=Países Bajos
##                                Genotipo Cromosoma Sev_relativa Temp
## 1             Genotipo=Solanum demissum         5        31.20   18
## 2             Genotipo=Solanum demissum         4        18.00   18
## 3             Genotipo=Solanum demissum        11        98.40   18
## 4             Genotipo=Solanum demissum        11        65.60   18
## 5             Genotipo=Solanum demissum        11        13.10   18
## 6             Genotipo=Solanum demissum        11        42.60   18
## 7             Genotipo=Solanum demissum        11        83.60   18
## 8             Genotipo=Solanum demissum        11        36.10   18
## 9             Genotipo=Solanum demissum        11         9.80   18
## 10            Genotipo=Solanum demissum        11        40.90   18
## 11            Genotipo=Solanum demissum        11        54.10   18
## 12            Genotipo=Solanum demissum         5        73.40   18
## 13            Genotipo=Solanum demissum         4        30.50   18
## 14            Genotipo=Solanum demissum        11        80.50   18
## 15            Genotipo=Solanum demissum        11        65.60   18
## 16            Genotipo=Solanum demissum        11         9.30   18
## 17            Genotipo=Solanum demissum        11        35.90   18
## 18            Genotipo=Solanum demissum        11        89.00   18
## 19            Genotipo=Solanum demissum        11        41.40   18
## 20            Genotipo=Solanum demissum        11        31.20   18
## 21            Genotipo=Solanum demissum        11        43.70   18
## 22            Genotipo=Solanum demissum        11        72.70   18
## 23            Genotipo=Solanum demissum         5        41.40   18
## 24            Genotipo=Solanum demissum         4        37.90   18
## 25            Genotipo=Solanum demissum        11        96.60   18
## 26            Genotipo=Solanum demissum        11        96.60   18
## 27            Genotipo=Solanum demissum        11        13.80   18
## 28            Genotipo=Solanum demissum        11        80.00   18
## 29            Genotipo=Solanum demissum        11        26.40   18
## 30            Genotipo=Solanum demissum        11        62.00   18
## 31            Genotipo=Solanum demissum        11        64.00   18
## 32    Genotipo=CEBECO-43154-5;CIP800986         5        20.90   18
## 33    Genotipo=CEBECO-44158-4;CIP800987         4        18.60   18
## 34     Genotipo=CEBECO-4642-1;CIP800988        11        93.00   18
## 35     Genotipo=CEBECO-4431-5;CIP800989        11        76.70   18
## 36     Genotipo=Black 3053-18;CIP800990        11        20.90   18
## 37    Genotipo=Black XD2-21; CIP 800991        11        53.50   18
## 38 Genotipo=Black 2182ef(7); CIP 800992        11        95.30   18
## 39  Genotipo=Black 2424a(5); CIP 800993        11        51.20   18
## 40      Genotipo=Black 2573; CIP 800994        11        23.30   18
## 41 Genotipo=Black 3618ad(1); CIP 800995        11        90.60   18
## 42 Genotipo=Black 5008ab(6); CIP 800996        11        30.20   18
## 43                       Genotipo=Black         5       100.00   16
## 44                       Genotipo=Black         4        58.00   16
## 45                       Genotipo=Black        11       100.00   16
## 46                       Genotipo=Black        11       100.00   16
## 47                       Genotipo=Black        11        81.00   16
## 48                       Genotipo=Black        11        67.00   16
## 49                       Genotipo=Black        11       100.00   16
## 50                       Genotipo=Black        11        60.00   16
## 51                       Genotipo=Black        11        17.00   16
## 52                       Genotipo=Black        11       100.00   16
## 53                       Genotipo=Black        11       100.00   16
## 54                       Genotipo=Black        11        79.30   15
## 55                       Genotipo=Black        11        89.00   15
## 56                         Genotipo=A09         8         3.79   15
## 57                         Genotipo=A15         9         0.14   15
## 58                         Genotipo=A09         8         8.19   15
## 59                         Genotipo=A15         9         1.00   15
## 60                         Genotipo=A09         8         1.15   15
## 61                         Genotipo=A09         8         0.16   15
## 62                       Genotipo=Black         5        56.40   18
## 63                       Genotipo=Black        11        43.00   18
## 64                       Genotipo=Black        11        51.30   18
## 65                    Genotipo=Atlantic         9        20.00   20
## 66                    Genotipo=Atlantic         8        20.00   20
## 67                      Genotipo=Bintje         9        20.00   20
## 68                      Genotipo=Bintje         8        20.00   20
## 69                      Genotipo=Potae9         8        20.00   20
## 70        Genotipo=MaR1: CEBECO 43154-5         5        75.00   16
## 71        Genotipo=MaR2: CEBECO 44158-4         4        39.00   16
## 72         Genotipo=MaR3: CEBECO 4642-1        11        73.00   16
## 73         Genotipo=MaR4: CEBECO 4431-5        11        59.00   16
## 74                     Genotipo=A03-142         4        37.50   16
## 75                      Genotipo=A04-33        11        75.00   16
## 76                      Genotipo=A25-11        11       100.00   16
## 77                     Genotipo=A09-277        11        25.00   16
## 78                      Genotipo=A01-20         8        25.00   16
## 79                      Genotipo=A23-43         8        28.20   16
## 80                      Genotipo=A02-33         6        12.50   16
## 81                      Genotipo=A13-13         9        12.50   16
## 82                      Genotipo=A17-27        10         9.40   16
plot(r_mca, label=c("var", "quali.sup"), xlim = c(-3,3), ylim = c(-2,3.5))
## Warning: Removed 2 rows containing missing values (geom_point).
## Warning: Removed 2 rows containing missing values (geom_text).
## Warning: Removed 2 rows containing missing values (geom_point).
## Warning: Removed 2 rows containing missing values (geom_text).

######################################

#library(lattice)
#library(ggplot2)
#Confidence ellipses around the categories for the variables
FactoMineR::plotellipses(r_mca, keepvar = 1:3, autoLab = "auto", cex=0.7)

?plotellipses
## starting httpd help server ...
##  done
library(Factoshiny)
## Loading required package: shiny
## Loading required package: FactoInvestigate
#outMCA<-MCAshiny(ref_art)
#outMCA<-MCAshiny(t)
res.MCA<-MCA(t[,-c(6)],quanti.sup=c(4,5),graph=FALSE)
plot.MCA(res.MCA, choix='var',axes=c(2,3))

plot.MCA(res.MCA,axes=c(2,3),invisible= 'ind',select= 'cos2 0.15',selectMod= 'cos2 0.2',habillage='cos2',label =c('var'))

plot.MCA(res.MCA, choix='quanti.sup',axes=c(2,3),title="Supplementary quantitatives variables",col.quanti.sup='#FF0099')

#Cos 1
res.MCA1<-MCA(t,quanti.sup=c(4,5,6),graph=FALSE)
summary(res.MCA1)
## 
## Call:
## MCA(X = t, quanti.sup = c(4, 5, 6), graph = FALSE) 
## 
## 
## Eigenvalues
##                        Dim.1   Dim.2   Dim.3   Dim.4   Dim.5   Dim.6   Dim.7
## Variance               0.966   0.774   0.702   0.667   0.667   0.667   0.667
## % of var.              5.366   4.300   3.902   3.704   3.704   3.704   3.704
## Cumulative % of var.   5.366   9.666  13.568  17.272  20.975  24.679  28.383
##                        Dim.8   Dim.9  Dim.10  Dim.11  Dim.12  Dim.13  Dim.14
## Variance               0.667   0.667   0.616   0.544   0.528   0.526   0.526
## % of var.              3.704   3.704   3.424   3.022   2.933   2.921   2.921
## Cumulative % of var.  32.086  35.790  39.214  42.236  45.170  48.091  51.012
##                       Dim.15  Dim.16  Dim.17  Dim.18  Dim.19  Dim.20  Dim.21
## Variance               0.514   0.500   0.490   0.482   0.482   0.480   0.477
## % of var.              2.858   2.778   2.721   2.680   2.680   2.665   2.647
## Cumulative % of var.  53.870  56.647  59.369  62.049  64.729  67.394  70.041
##                       Dim.22  Dim.23  Dim.24  Dim.25  Dim.26  Dim.27  Dim.28
## Variance               0.459   0.356   0.333   0.333   0.333   0.333   0.333
## % of var.              2.552   1.978   1.852   1.852   1.852   1.852   1.852
## Cumulative % of var.  72.593  74.571  76.423  78.275  80.127  81.979  83.831
##                       Dim.29  Dim.30  Dim.31  Dim.32  Dim.33  Dim.34  Dim.35
## Variance               0.333   0.333   0.333   0.207   0.184   0.184   0.175
## % of var.              1.852   1.852   1.852   1.152   1.024   1.024   0.972
## Cumulative % of var.  85.682  87.534  89.386  90.538  91.562  92.585  93.557
##                       Dim.36  Dim.37  Dim.38  Dim.39  Dim.40  Dim.41  Dim.42
## Variance               0.167   0.166   0.159   0.141   0.141   0.141   0.127
## % of var.              0.926   0.923   0.882   0.785   0.783   0.783   0.708
## Cumulative % of var.  94.483  95.407  96.288  97.074  97.856  98.639  99.347
##                       Dim.43  Dim.44  Dim.45  Dim.46  Dim.47  Dim.48  Dim.49
## Variance               0.064   0.053   0.000   0.000   0.000   0.000   0.000
## % of var.              0.357   0.296   0.000   0.000   0.000   0.000   0.000
## Cumulative % of var.  99.704 100.000 100.000 100.000 100.000 100.000 100.000
##                       Dim.50  Dim.51  Dim.52  Dim.53  Dim.54
## Variance               0.000   0.000   0.000   0.000   0.000
## % of var.              0.000   0.000   0.000   0.000   0.000
## Cumulative % of var. 100.000 100.000 100.000 100.000 100.000
## 
## Individuals (the 10 first)
##                 Dim.1    ctr   cos2    Dim.2    ctr   cos2    Dim.3    ctr
## 1            | -0.559  0.395  0.062 |  0.002  0.000  0.000 |  0.417  0.302
## 2            | -0.542  0.371  0.052 |  0.022  0.001  0.000 |  0.730  0.925
## 3            | -0.542  0.371  0.052 |  0.022  0.001  0.000 |  0.730  0.925
## 4            | -0.542  0.371  0.052 |  0.022  0.001  0.000 |  0.730  0.925
## 5            | -0.643  0.522  0.063 | -0.059  0.006  0.001 |  0.740  0.951
## 6            | -0.644  0.524  0.052 | -0.063  0.006  0.000 |  0.641  0.714
## 7            | -0.643  0.522  0.063 | -0.059  0.006  0.001 |  0.740  0.951
## 8            | -0.643  0.522  0.063 | -0.059  0.006  0.001 |  0.740  0.951
## 9            | -0.644  0.524  0.052 | -0.063  0.006  0.000 |  0.641  0.714
## 10           | -0.646  0.527  0.083 | -0.071  0.008  0.001 |  0.193  0.065
##                cos2  
## 1             0.035 |
## 2             0.094 |
## 3             0.094 |
## 4             0.094 |
## 5             0.083 |
## 6             0.052 |
## 7             0.083 |
## 8             0.083 |
## 9             0.052 |
## 10            0.007 |
## 
## Categories (the 10 first)
##                 Dim.1    ctr   cos2 v.test    Dim.2    ctr   cos2 v.test  
## R1           | -0.413  0.502  0.016 -1.135 |  0.080  0.023  0.001  0.219 |
## R10          | -0.669  1.318  0.042 -1.839 | -0.113  0.047  0.001 -0.309 |
## R11          | -0.669  1.318  0.042 -1.839 | -0.113  0.047  0.001 -0.309 |
## R2           | -0.362  0.331  0.010 -0.915 |  0.134  0.056  0.001  0.338 |
## R3           | -0.362  0.331  0.010 -0.915 |  0.134  0.056  0.001  0.338 |
## R3a          |  1.588  1.062  0.031  1.588 |  2.358  2.921  0.069  2.358 |
## R3b          |  1.588  1.062  0.031  1.588 |  2.358  2.921  0.069  2.358 |
## R4           | -0.362  0.331  0.010 -0.915 |  0.134  0.056  0.001  0.338 |
## R5           | -0.660  0.917  0.028 -1.514 | -0.081  0.017  0.000 -0.187 |
## R6           | -0.664  0.741  0.023 -1.352 | -0.090  0.017  0.000 -0.184 |
##               Dim.3    ctr   cos2 v.test  
## R1           -0.356  0.512  0.012 -0.978 |
## R10          -0.918  3.412  0.079 -2.523 |
## R11          -0.918  3.412  0.079 -2.523 |
## R2            0.432  0.647  0.015  1.091 |
## R3            0.432  0.647  0.015  1.091 |
## R3a          -0.150  0.013  0.000 -0.150 |
## R3b          -0.150  0.013  0.000 -0.150 |
## R4            0.432  0.647  0.015  1.091 |
## R5            0.457  0.605  0.014  1.049 |
## R6            0.208  0.101  0.002  0.425 |
## 
## Categorical variables (eta2)
##                Dim.1 Dim.2 Dim.3  
## Gen          | 0.948 0.778 0.240 |
## Pais         | 0.951 0.581 0.928 |
## Genotipo     | 0.998 0.964 0.939 |
## 
## Supplementary continuous variables
##                 Dim.1    Dim.2    Dim.3  
## Cromosoma    | -0.257 | -0.078 | -0.003 |
## Sev_relativa | -0.478 |  0.222 | -0.260 |
## Temp         | -0.296 |  0.021 |  0.458 |
plot.MCA(res.MCA1, choix='var',axes=c(2,3))

plot.MCA(res.MCA1,axes=c(2,3),invisible= 'ind',select= 'cos2 0.05',selectMod= 'cos2 0.05',habillage='cos2',cex=0.9,cex.main=0.9,cex.axis=0.9,label =c('var'))
## Warning: ggrepel: 14 unlabeled data points (too many overlaps). Consider
## increasing max.overlaps

plot.MCA(res.MCA1, choix='quanti.sup',axes=c(2,3),title="Supplementary quantitatives variables")

################################33
fviz_mca_var(res.MCA1, col.var = "cos2",
             gradient.cols = c("#00AFBB", "#E7B800", "#FC4E07"), 
             repel = TRUE, # Avoid text overlapping
             ggtheme = theme_minimal())
## Warning: ggrepel: 42 unlabeled data points (too many overlaps). Consider
## increasing max.overlaps

fviz_cos2(res.MCA1, choice = "var", axes = 1:2)

# Contributions of rows to dimension 1
fviz_contrib(res.MCA1, choice = "var", axes = 1, top = 15)

# Contributions of rows to dimension 2
fviz_contrib(res.MCA1, choice = "var", axes = 2, top = 15)

fviz_mca_ind(res.MCA1, habillage = 2, addEllipses = TRUE)
## Warning: Computation failed in `stat_ellipse()`:
## the leading minor of order 2 is not positive definite

# habillage = external grouping variable
fviz_mca_ind(res.MCA1, habillage = t$Gen, addEllipses = TRUE)
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse

# Biplot of individuals and variable categories
fviz_mca_biplot(res.MCA1, repel = TRUE,
                ggtheme = theme_minimal())
## Warning: ggrepel: 65 unlabeled data points (too many overlaps). Consider
## increasing max.overlaps
## Warning: ggrepel: 42 unlabeled data points (too many overlaps). Consider
## increasing max.overlaps

##################################3
FactoMineR::plotellipses(res.MCA1, keepvar = 1:3, autoLab = "auto", cex=0.7)

#COS2 SIN TEMP
res.MCA<-MCA(t[,-c(6)],quanti.sup=c(4,5),graph=FALSE)
plot.MCA(res.MCA, choix='var',axes=c(2,3),col.var=c(1,2,3),cex=1.05,cex.main=1.05,cex.axis=1.05)

plot.MCA(res.MCA,axes=c(2,3),invisible= 'ind',select= 'cos2 0.05',selectMod= 'cos2 0.05',habillage='cos2',col.ind='#1B1BDB92',label =c('var'))
## Warning: ggrepel: 14 unlabeled data points (too many overlaps). Consider
## increasing max.overlaps

plot.MCA(res.MCA, choix='quanti.sup',axes=c(2,3),title="Supplementary quantitatives variables",cex=1.15,cex.main=1.15,cex.axis=1.15)

library(FactoInvestigate)
#FactoInvestigate
#graphCA(res.MCA)
ggplot(t, aes(Gen, Sev_relativa))+geom_boxplot()

ggplot(data = t, aes(x = Gen, y = Sev_relativa, group = 1))+ 
  geom_point(aes(color = Genotipo))+
  theme(legend.title=element_blank()) +
  facet_wrap(vars(Pais),scales = "free_y", nrow = 5)

p <- ggplot(t, aes(Gen, Sev_relativa)) + geom_point()
p + facet_wrap(vars(Genotipo))