ericgoolsby / Rphylopars

Phylogenetic Comparative Tools for Missing Data and Within-Species Variation
28 stars 11 forks source link

ERROR while rich displaying an object #40

Closed nick-youngblut closed 3 years ago

nick-youngblut commented 4 years ago

phylopars() is returning the object:

'logLik''pars''model''mu''npars''anc_recon''anc_var''anc_cov''tree''trait_data''REML'

...but also generates the error:

ERROR while rich displaying an object: Error in apply(PPE$trait_data[, 1:nvar + 1], 2, function(X) var(X, na.rm = TRUE)): dim(X) must have a positive length

Traceback:
1. FUN(X[[i]], ...)
2. tryCatch(withCallingHandlers({
 .     if (!mime %in% names(repr::mime2repr)) 
 .         stop("No repr_* for mimetype ", mime, " in repr::mime2repr")
 .     rpr <- repr::mime2repr[[mime]](obj)
 .     if (is.null(rpr)) 
 .         return(NULL)
 .     prepare_content(is.raw(rpr), rpr)
 . }, error = error_handler), error = outer_handler)
3. tryCatchList(expr, classes, parentenv, handlers)
4. tryCatchOne(expr, names, parentenv, handlers[[1L]])
5. doTryCatch(return(expr), name, parentenv, handler)
6. withCallingHandlers({
 .     if (!mime %in% names(repr::mime2repr)) 
 .         stop("No repr_* for mimetype ", mime, " in repr::mime2repr")
 .     rpr <- repr::mime2repr[[mime]](obj)
 .     if (is.null(rpr)) 
 .         return(NULL)
 .     prepare_content(is.raw(rpr), rpr)
 . }, error = error_handler)
7. repr::mime2repr[[mime]](obj)
8. repr_text.default(obj)
9. paste(capture.output(print(obj)), collapse = "\n")
10. capture.output(print(obj))
11. evalVis(expr)
12. withVisible(eval(expr, pf))
13. eval(expr, pf)
14. eval(expr, pf)
15. print(obj)
16. print.phylopars(obj)
17. apply(PPE$trait_data[, 1:nvar + 1], 2, function(X) var(X, na.rm = TRUE))
18. stop("dim(X) must have a positive length")

I'm guessing that this has something to do with my environment:

R version 4.0.0 (2020-04-24)
Platform: x86_64-conda_cos6-linux-gnu (64-bit)
Running under: Ubuntu 18.04.4 LTS

Matrix products: default
BLAS/LAPACK: /ebio/abt3_projects/Georg_animal_feces/envs/phyloseq-physig/lib/libopenblasp-r0.3.9.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] 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   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
 [1] LeyLabRMisc_0.1.6 doParallel_1.0.15 iterators_1.0.12  foreach_1.5.0    
 [5] Rphylopars_0.3.0  phytools_0.7-47   maps_3.3.0        ape_5.4          
 [9] ggplot2_3.3.1     tidyr_1.1.0       dplyr_1.0.0      

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.4.6            subplex_1.6             mvtnorm_1.1-1          
 [4] lattice_0.20-41         phylolm_2.6             listenv_0.8.0          
 [7] gtools_3.8.2            RhpcBLASctl_0.20-137    digest_0.6.25          
[10] IRdisplay_0.7.0         R6_2.4.1                repr_1.1.0             
[13] backports_1.1.7         evaluate_0.14           coda_0.19-3            
[16] pillar_1.4.4            rlang_0.4.6             uuid_0.1-4             
[19] phangorn_2.5.5          Matrix_1.2-18           combinat_0.0-8         
[22] igraph_1.2.5            munsell_0.5.0           broom_0.5.6            
[25] compiler_4.0.0          numDeriv_2016.8-1.1     Deriv_4.0              
[28] geiger_2.0.7            pkgconfig_2.0.3         base64enc_0.1-3        
[31] mnormt_1.5-7            globals_0.12.5          htmltools_0.4.0        
[34] tidyselect_1.1.0        tibble_3.0.1            expm_0.999-4           
[37] quadprog_1.5-8          codetools_0.2-16        future_1.17.0          
[40] crayon_1.3.4            withr_2.2.0             MASS_7.3-51.6          
[43] grid_4.0.0              nlme_3.1-148            jsonlite_1.6.1         
[46] gtable_0.3.0            lifecycle_0.2.0         magrittr_1.5           
[49] scales_1.1.1            future.apply_1.5.0      scatterplot3d_0.3-41   
[52] doBy_4.6.6              ellipsis_0.3.1          generics_0.0.2         
[55] vctrs_0.3.1             fastmatch_1.1-0         IRkernel_1.1           
[58] deSolve_1.28            tools_4.0.0             glue_1.4.1             
[61] purrr_0.3.4             plotrix_3.7-8           colorspace_1.4-1       
[64] pbdZMQ_0.3-3            animation_2.6           clusterGeneration_1.3.4
ericgoolsby commented 3 years ago

I think this was an issue with print.phylopars. Does the devel branch (currently 0.3.5) address this issue?

nick-youngblut commented 3 years ago

This appears to be fixed in the dev version