Hy4m/linkET

issue in using different distance matrix for mantel test ()

Closed this issue · 4 comments

I want give bray curtis distance in spec_dist and euclidean distance in env_dist but unfortunately I unable to give and it automatically taking euclidean distance for both the data. How to set different distance matrix for both the data in matel_test() function.

Hy4m commented

In summary, this is because the spec does not meet the basic condition for using the Bray distance method (the sum of any row is not equal to zero).

Can you give some example how i can use bray-curtis distance?

Maybe set spec_dist argument to dist_func(.FUN = "vegdist", method = "bray")

after setting the argument to dist_func(.FUN = "vegdist", method = "bray"), I got error like this
mantel_test() using 'euclidean' dist method for 'env'.
Error in purrr::pmap():
ℹ In index: 61.
Caused by error in cor():
! missing observations in cov/cor
Run rlang::last_trace() to see where the error occurred.
There were 14 warnings (use warnings() to see them)

please help me how to solve this error.