Running examples in ‘statVisual-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: PCA_score
> ### Title: Scatter Plot of 2 Specified Principal Components
> ### Aliases: PCA_score
> ### Keywords: method
> 
> ### ** Examples
> 
> library(factoextra)
Welcome! Want to learn more? See two factoextra-related books at https://goo.gl/ve3WBa
> 
> data(esSim)
> print(esSim)
ExpressionSet (storageMode: lockedEnvironment)
assayData: 100 features, 20 samples 
  element names: exprs 
protocolData: none
phenoData
  sampleNames: subj1 subj2 ... subj20 (20 total)
  varLabels: sid grp
  varMetadata: labelDescription
featureData
  featureNames: probe1 probe2 ... probe100 (100 total)
  fvarLabels: probeid gene chr
  fvarMetadata: labelDescription
experimentData: use 'experimentData(object)'
Annotation:  
> 
> # expression data
> dat = exprs(esSim)
> print(dim(dat))
[1] 100  20
> print(dat[1:2,])
          subj1    subj2    subj3    subj4    subj5    subj6    subj7    subj8
probe1 1.462929 1.596203 2.252267 1.974616 1.842606 1.677204 2.242665 1.705923
probe2 1.574342 2.232537 1.846260 1.980999 2.483777 2.048599 1.786081 1.934728
          subj9   subj10     subj11     subj12      subj13    subj14     subj15
probe1 1.758028 1.919597 0.07477602  0.3054811  0.12356526 0.3221119 -0.1346480
probe2 1.740329 1.942189 0.08308643 -0.1012774 -0.06669481 0.5413783  0.0245575
            subj16     subj17    subj18     subj19     subj20
probe1 -0.03845011  0.3504460 0.4173905 -0.1438801  0.3335083
probe2 -0.03849619 -0.2536194 0.1420066 -0.1072697 -0.1750033
> 
> # phenotype data
> pDat = pData(esSim)
> print(dim(pDat))
[1] 20  2
> print(pDat[1:2,])
        sid grp
subj1 subj1   1
subj2 subj2   1
> 
> # feature data
> fDat = fData(esSim)
> print(dim(fDat))
[1] 100   3
> print(fDat[1:2,])
       probeid      gene chr
probe1  probe1 fakeGene1   1
probe2  probe2 fakeGene2   1
> 
> # choose the first 6 probes (3 OE probes, 2 UE probes, and 1 NE probe)
> pDat$probe1 = dat[1,]
> pDat$probe2 = dat[2,]
> pDat$probe3 = dat[3,]
> pDat$probe4 = dat[4,]
> pDat$probe5 = dat[5,]
> pDat$probe6 = dat[6,]
> 
> print(pDat[1:2, ])
        sid grp   probe1   probe2   probe3    probe4    probe5    probe6
subj1 subj1   1 1.462929 1.574342 2.015327 -2.137848 -1.992898 1.0472686
subj2 subj2   1 1.596203 2.232537 2.141727 -2.639981 -1.926786 0.3904537
> 
> # check histograms of probe 1 expression in cases and controls
> print(table(pDat$grp, useNA = "ifany"))

 0  1 
10 10 
> 
> pDat$grp = factor(pDat$grp)
> 
> ###
> 
> pca.obj = iprcomp(pDat[, c(3:8)], scale. = TRUE)
> 
> # scree plot
> factoextra::fviz_eig(pca.obj, addlabels = TRUE)
> 
> # scatter plot of PC1 vs PC2
> statVisual(type = 'PCA_score',
+            prcomp_obj = pca.obj, 
+            dims = c(1, 2),
+            data = pDat, 
+            color = 'grp',
+            loadings = FALSE)
Warning: `select_()` was deprecated in dplyr 0.7.0.
Please use `select()` instead.
This warning is displayed once every 8 hours.
Call `lifecycle::last_lifecycle_warnings()` to see where this warning was generated.
Error in FUN(x, aperm(array(STATS, dims[perm]), order(perm)), ...) : 
  non-numeric argument to binary operator
Calls: statVisual -> PCA_score -> mahalanobis -> sweep
Execution halted