adw96 / DivNet

diversity estimation under ecological networks
83 stars 18 forks source link

R warning #58

Closed adityabandla closed 3 years ago

adityabandla commented 4 years ago

I get the following warning when trying to run DivNet, even with the example data

Warning message in if (class(test) == "try-error") {:
“the condition has length > 1 and only the first element will be used”
Warning message in if (class(outcome) == "try-error") {:
“the condition has length > 1 and only the first element will be used”
Warning message in if (class(outcome) == "try-error") {:
“the condition has length > 1 and only the first element will be used”
Warning message in if (class(outcome) == "try-error") {:
“the condition has length > 1 and only the first element will be used”
Warning message in if (class(outcome) == "try-error") {:
“the condition has length > 1 and only the first element will be used”
adw96 commented 4 years ago

Hi @adityabandla -- please provide your R version and session info. An example of how to do so is here: https://github.com/adw96/breakaway/issues/79

Cheers,

Amy

adityabandla commented 4 years ago

Hi Amy

Here goes

R version 4.0.0 (2020-04-24)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Catalina 10.15.5

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages:
 [1] magrittr_1.5     phyloseq_1.32.0  breakaway_4.6.16 forcats_0.5.0   
 [5] stringr_1.4.0    dplyr_1.0.0      purrr_0.3.4      readr_1.3.1     
 [9] tidyr_1.1.0      tibble_3.0.1     ggplot2_3.3.1    tidyverse_1.3.0 

loaded via a namespace (and not attached):
 [1] nlme_3.1-147        fs_1.4.1            usethis_1.6.1      
 [4] lubridate_1.7.8     devtools_2.3.0      httr_1.4.1         
 [7] rprojroot_1.3-2     tools_4.0.0         backports_1.1.7    
[10] vegan_2.5-6         R6_2.4.1            mgcv_1.8-31        
[13] DBI_1.1.0           BiocGenerics_0.34.0 colorspace_1.4-1   
[16] permute_0.9-5       ade4_1.7-15         withr_2.2.0        
[19] tidyselect_1.1.0    prettyunits_1.1.1   processx_3.4.2     
[22] curl_4.3            compiler_4.0.0      cli_2.0.2          
[25] rvest_0.3.5         Biobase_2.48.0      xml2_1.3.2         
[28] desc_1.2.0          scales_1.1.1        callr_3.4.3        
[31] digest_0.6.25       XVector_0.28.0      pkgconfig_2.0.3    
[34] sessioninfo_1.1.1   dbplyr_1.4.3        rlang_0.4.6        
[37] readxl_1.3.1        rstudioapi_0.11     generics_0.0.2     
[40] jsonlite_1.6.1      Matrix_1.2-18       biomformat_1.16.0  
[43] Rhdf5lib_1.10.0     Rcpp_1.0.4.6        munsell_0.5.0      
[46] S4Vectors_0.26.1    fansi_0.4.1         ape_5.3            
[49] lifecycle_0.2.0     stringi_1.4.6       MASS_7.3-51.6      
[52] zlibbioc_1.34.0     rhdf5_2.32.0        pkgbuild_1.0.8     
[55] plyr_1.8.6          grid_4.0.0          parallel_4.0.0     
[58] crayon_1.3.4        lattice_0.20-41     splines_4.0.0      
[61] Biostrings_2.56.0   haven_2.2.0         multtest_2.44.0    
[64] hms_0.5.3           ps_1.3.3            pillar_1.4.4       
[67] igraph_1.2.5        reshape2_1.4.4      codetools_0.2-16   
[70] stats4_4.0.0        pkgload_1.0.2       reprex_0.3.0       
[73] glue_1.4.1          data.table_1.12.8   remotes_2.1.1      
[76] modelr_0.1.7        vctrs_0.3.1         foreach_1.5.0      
[79] testthat_2.3.2      cellranger_1.1.0    gtable_0.3.0       
[82] assertthat_0.2.1    broom_0.5.6         survival_3.1-12    
[85] iterators_1.0.12    memoise_1.1.0       IRanges_2.22.1     
[88] cluster_2.1.0       ellipsis_0.3.1 

Cheers, Adi

adw96 commented 4 years ago

@adityabandla It doesn't look like you've loaded DivNet (e.g. with library(Divnet)), so I can't see what version you have, and therefore can't reproduce your issue. We did recently update DivNet to fix this issue, so it may disappear if you run

remotes::install_github("adw96/DivNet")
library(DivNet)
adityabandla commented 4 years ago

Sorry for missing that, its DivNet_0.3.6

adw96 commented 4 years ago

Ok, thanks. Can you please run

remotes::install_github("adw96/DivNet")
library(DivNet)

and tell me if this fixes the issue?

adw96 commented 4 years ago

Btw, I recommend this because these new warnings appear in R 4.0 and greater, and we recently made some edits that address them. I want to make sure that you have the version with those edits.

adityabandla commented 4 years ago

Yup, tried that, still the same issue

Skipping install of 'DivNet' from a github remote, the SHA1 (160daaf2) has not changed since last install.
Use `force = TRUE` to force installation
adw96 commented 4 years ago

Ok, I need the exact code you ran in the exact order you ran it in order to help. Here is what I get when I run the following

> remotes::install_github("adw96/DivNet")
Downloading GitHub repo adw96/DivNet@master
Skipping 2 packages not available: phyloseq, breakaway
Skipping 1 packages ahead of CRAN: Rcpp
checking for file ‘/private/var/folders/j_/4kw5ygpn39d937k0tbcbr_lw0000gp/T/Rtmpq5zDhY/remotes18bf47aa5891/adw96-DivNet-160daaf/DESCRIPTION’ ...✓  checking for file ‘/private/var/folders/j_/4kw5ygpn39d937k0tbcbr_lw0000gp/T/Rtmpq5zDhY/remotes18bf47aa5891/adw96-DivNet-160daaf/DESCRIPTION’
─  preparing ‘DivNet’:
  ✓  checking DESCRIPTION meta-information ...
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  building ‘DivNet_0.3.6.tar.gz’

* installing *source* package ‘DivNet’ ...
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (DivNet)
> library(DivNet)
Loading required package: phyloseq
Loading required package: breakaway
> sessionInfo()
R version 4.0.1 (2020-06-06)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Catalina 10.15.5

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

locale:
  [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages:
  [1] DivNet_0.3.6     breakaway_4.6.16 phyloseq_1.32.0 

loaded via a namespace (and not attached):
  [1] Rcpp_1.0.4.12       ape_5.4             lattice_0.20-41     tidyr_1.1.0        
[5] prettyunits_1.1.1   ps_1.3.3            Biostrings_2.56.0   assertthat_0.2.1   
[9] rprojroot_1.3-2     foreach_1.5.0       R6_2.4.1            plyr_1.8.6         
[13] backports_1.1.8     stats4_4.0.1        ggplot2_3.3.2       pillar_1.4.4       
[17] zlibbioc_1.34.0     rlang_0.4.6         curl_4.3            rstudioapi_0.11    
[21] data.table_1.12.8   vegan_2.5-6         callr_3.4.3         S4Vectors_0.26.1   
[25] mvnfast_0.2.5       Matrix_1.2-18       splines_4.0.1       stringr_1.4.0      
[29] igraph_1.2.5        munsell_0.5.0       compiler_4.0.1      pkgconfig_2.0.3    
[33] BiocGenerics_0.34.0 multtest_2.44.0     pkgbuild_1.0.8      mgcv_1.8-31        
[37] biomformat_1.16.0   tidyselect_1.1.0    tibble_3.0.1        IRanges_2.22.2     
[41] codetools_0.2-16    permute_0.9-5       fansi_0.4.1         crayon_1.3.4       
[45] dplyr_1.0.0         withr_2.2.0         MASS_7.3-51.6       grid_4.0.1         
[49] nlme_3.1-148        jsonlite_1.6.1      gtable_0.3.0        lifecycle_0.2.0    
[53] magrittr_1.5        scales_1.1.1        cli_2.0.2           stringi_1.4.6      
[57] XVector_0.28.0      reshape2_1.4.4      remotes_2.1.1       doParallel_1.0.15  
[61] ellipsis_0.3.1      vctrs_0.3.1         generics_0.0.2      Rhdf5lib_1.10.0    
[65] iterators_1.0.12    tools_4.0.1         ade4_1.7-15         Biobase_2.48.0     
[69] glue_1.4.1          purrr_0.3.4         abind_1.4-5         processx_3.4.2     
[73] parallel_4.0.1      survival_3.2-3      colorspace_1.4-1    rhdf5_2.32.0       
[77] cluster_2.1.0      
> data("Lee")
> library(magrittr)
> divnet(Lee %>% tax_glom("Phylum"), formula= ~char)
|======================================================================================| 100%
|======================================================================================| 100%
|======================================================================================| 100%
|======================================================================================| 100%
|======================================================================================| 100%
|======================================================================================| 100%
An object of class `diversityEstimates` with the following elements:
  -  shannon 
-  simpson 
-  bray-curtis 
-  euclidean 
-  shannon-variance 
-  simpson-variance 
-  bray-curtis-variance 
-  euclidean-variance 
-  X 
-  fitted_z 
Access individual components with, e.g., object$shannon and object$`shannon-variance`
Use function testDiversity() to test hypotheses about diversity
> 

If you can give me a MWE to reproduce the error I can help further.