zarquon42b / Morpho

R-package providing a toolset for (3D-based) Geometric Morphometrics
51 stars 16 forks source link

Displacement vectors no longer seem to work #27

Closed J0vid closed 3 years ago

J0vid commented 3 years ago

Hi, I've noticed an error in meshDist that no longer allows displacement vectors to be plotted. It seems to be the case even with the example provided in the documentation:

library(Morpho)
data(nose)
longnose.mesh <- tps3d(shortnose.mesh, shortnose.lm, longnose.lm,threads=1)   
mD <- meshDist(longnose.mesh, shortnose.mesh, displace = T)  

The error I've consistently seen across several versions of R/Morpho is: Error in normals[as.numeric(inds), ] : subscript out of bounds

Any insight would be appreciated! -David

PS - Session info below in case that's useful.

R version 4.1.0 (2021-05-18) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 19042)

Matrix products: default

locale: [1] LC_COLLATE=English_United States.1252 [2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 [4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

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

other attached packages: [1] Morpho_2.8

loaded via a namespace (and not attached): [1] Rcpp_1.0.6
[2] magrittr_2.0.1
[3] knitr_1.33
[4] MASS_7.3-54
[5] doParallel_1.0.16
[6] xtable_1.8-4
[7] lattice_0.20-44
[8] R6_2.5.0
[9] Rvcg_0.19.2
[10] rlang_0.4.11
[11] fastmap_1.1.0
[12] foreach_1.5.1
[13] tools_4.1.0
[14] parallel_4.1.0
[15] grid_4.1.0
[16] xfun_0.24
[17] miniUI_0.1.1.1
[18] ellipsis_0.3.2
[19] htmltools_0.5.1.1
[20] crosstalk_1.1.1
[21] iterators_1.0.13
[22] shinyjs_2.0.0
[23] abind_1.4-5
[24] digest_0.6.27
[25] rgl_0.106.8
[26] lifecycle_1.0.0
[27] Matrix_1.3-3
[28] shiny_1.6.0
[29] later_1.2.0
[30] promises_1.2.0.1
[31] htmlwidgets_1.5.3
[32] codetools_0.2-18
[33] manipulateWidget_0.11.0 [34] mime_0.11
[35] evaluate_0.14
[36] rmarkdown_2.11
[37] compiler_4.1.0
[38] colorRamps_2.3
[39] jsonlite_1.7.2
[40] httpuv_1.6.1

zarquon42b commented 3 years ago

Sorry for the late reply. Thanks for reporting the bug and the PR. This seems to be an issue with the latest rgl version). I also fixed the wrong coloring for meshDist.matrix Please install the latest master branch and check. Fixed in #29 and 3606ff8 Thanks a lot Stefan