'predict' is not an exported object from 'namespace:mixOmics'

Hi,

I’m following the sPLS-DA vingette, when It comes to the part of prediction I get the following error with the predict function

predict ← mixOmics::predict
Error: ‘predict’ is not an exported object from ‘namespace:mixOmics’

sessionInfo()
R version 4.2.1 (2022-06-23)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.4 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/liblapack.so.3

locale:
 [1] LC_CTYPE=en_US.UTF-8          LC_NUMERIC=C                  LC_TIME=en_US.UTF-8           LC_COLLATE=en_US.UTF-8       
 [5] LC_MONETARY=en_US.UTF-8       LC_MESSAGES=en_US.UTF-8       LC_PAPER=en_US.UTF-8          LC_NAME=en_US.UTF-8          
 [9] LC_ADDRESS=en_US.UTF-8        LC_TELEPHONE=en_US.UTF-8      LC_MEASUREMENT=en_US.UTF-8    LC_IDENTIFICATION=en_US.UTF-8

attached base packages:
[1] stats4    stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] PCAtools_2.8.0                           ggrepel_0.9.3                            pheatmap_1.0.12                         
 [4] edgeR_3.38.4                             limma_3.52.4                             mixOmics_6.23.4                         
 [7] lattice_0.20-45                          MASS_7.3-58                              readr_2.1.3                             
[10] ggfortify_0.4.16                         ggplot2_3.4.1                            DESeq2_1.36.0                           
[13] SummarizedExperiment_1.26.1              MatrixGenerics_1.8.1                     matrixStats_0.62.0                      
[16] tibble_3.1.8                             EnsDb.Hsapiens.v86_2.99.0                ensembldb_2.20.2                        
[19] AnnotationFilter_1.20.0                  TxDb.Hsapiens.UCSC.hg38.knownGene_3.15.0 GenomicFeatures_1.48.4                  
[22] AnnotationDbi_1.58.0                     Biobase_2.56.0                           GenomicRanges_1.48.0                    
[25] GenomeInfoDb_1.32.4                      IRanges_2.30.1                           S4Vectors_0.34.0                        
[28] BiocGenerics_0.42.0                      tximport_1.24.0                          stringr_1.5.0                           
[31] readxl_1.4.1                             xlsx_0.6.5                               plyr_1.8.7                              
[34] tidyr_1.3.0                              dplyr_1.0.10                            

loaded via a namespace (and not attached):
  [1] utf8_1.2.2                tidyselect_1.2.0          RSQLite_2.2.18            htmlwidgets_1.5.4        
  [5] grid_4.2.1                BiocParallel_1.30.4       devtools_2.4.5            munsell_0.5.0            
  [9] ScaledMatrix_1.4.1        codetools_0.2-18          miniUI_0.1.1.1            withr_2.5.0              
 [13] colorspace_2.0-3          filelock_1.0.2            knitr_1.40                rstudioapi_0.14          
 [17] rJava_1.0-6               labeling_0.4.2            GenomeInfoDbData_1.2.8    bit64_4.0.5              
 [21] farver_2.1.1              rprojroot_2.0.3           vctrs_0.5.2               generics_0.1.3           
 [25] xfun_0.34                 BiocFileCache_2.4.0       R6_2.5.1                  rsvd_1.0.5               
 [29] locfit_1.5-9.6            bitops_1.0-7              cachem_1.0.6              DelayedArray_0.22.0      
 [33] assertthat_0.2.1          promises_1.2.0.1          BiocIO_1.6.0              scales_1.2.1             
 [37] vroom_1.6.0               gtable_0.3.1              beachmat_2.12.0           processx_3.7.0           
 [41] rlang_1.0.6               genefilter_1.78.0         splines_4.2.1             rtracklayer_1.56.1       
 [45] GenVisR_1.28.0            lazyeval_0.2.2            yaml_2.3.6                reshape2_1.4.4           
 [49] httpuv_1.6.6              tools_4.2.1               usethis_2.1.6             ellipsis_0.3.2           
 [53] RColorBrewer_1.1-3        sessioninfo_1.2.2         Rcpp_1.0.9                sparseMatrixStats_1.8.0  
 [57] progress_1.2.2            zlibbioc_1.42.0           purrr_1.0.1               RCurl_1.98-1.9           
 [61] ps_1.7.1                  prettyunits_1.1.1         viridis_0.6.2             cowplot_1.1.1            
 [65] urlchecker_1.0.1          fs_1.5.2                  magrittr_2.0.3            data.table_1.14.4        
 [69] RSpectra_0.16-1           ProtGenerics_1.28.0       pkgload_1.3.0             hms_1.1.2                
 [73] xlsxjars_0.6.1            mime_0.12                 evaluate_0.17             xtable_1.8-4             
 [77] XML_3.99-0.11             gridExtra_2.3             compiler_4.2.1            biomaRt_2.52.0           
 [81] ellipse_0.4.3             crayon_1.5.2              htmltools_0.5.4           corpcor_1.6.10           
 [85] later_1.3.0               tzdb_0.3.0                geneplotter_1.74.0        DBI_1.1.3                
 [89] dbplyr_2.2.1              rappdirs_0.3.3            Matrix_1.5-1              cli_3.4.1                
 [93] parallel_4.2.1            igraph_1.4.0              pkgconfig_2.0.3           GenomicAlignments_1.32.1 
 [97] xml2_1.3.3                rARPACK_0.11-0            annotate_1.74.0           dqrng_0.3.0              
[101] XVector_0.36.0            VariantAnnotation_1.42.1  callr_3.7.2               digest_0.6.30            
[105] Biostrings_2.64.1         rmarkdown_2.17            cellranger_1.1.0          DelayedMatrixStats_1.18.2
[109] restfulr_0.0.15           curl_4.3.3                shiny_1.7.2               Rsamtools_2.12.0         
[113] gtools_3.9.3              rjson_0.2.21              FField_0.1.0              lifecycle_1.0.3          
[117] jsonlite_1.8.3            viridisLite_0.4.1         BSgenome_1.64.0           fansi_1.0.3              
[121] pillar_1.8.1              KEGGREST_1.36.3           fastmap_1.1.0             httr_1.4.4               
[125] pkgbuild_1.3.1            survival_3.5-5            glue_1.6.2                remotes_2.4.2            
[129] png_0.1-7                 bit_4.0.4                 stringi_1.7.8             profvis_0.3.7            
[133] blob_1.2.3                BiocSingular_1.12.0       memoise_2.0.1             irlba_2.3.5.1

hi @Jose_Gracia

Probably try to name it otherwise (just to avoid confusion, as you are assigning an object with a function with the same name. I also note that you don’t seem to use the function correctly, it should be something like:

myPredictResult <- mixOmics::predict(anObject)

See our help files, vignettes etc

Kim-Anh