Giter VIP home page Giter VIP logo

Comments (4)

B-1991-ing avatar B-1991-ing commented on June 7, 2024

Hi Houyun,

Update

I noticed that when the table has the number value as "0", the error warning appeared.

Table screenshot
Screenshot 2022-11-05 at 17 53 15

Error screenshot
Screenshot 2022-11-05 at 17 54 12

Best,

Bing

from linket.

B-1991-ing avatar B-1991-ing commented on June 7, 2024

If I have a matrix with the first whole column of 0 in the matrix. Should I directly delete it from the data frame?

Data frame screenshot
Screenshot 2022-11-05 at 23 39 05

Best,

Bing

from linket.

Hy4m avatar Hy4m commented on June 7, 2024

Hi Bing

I think this happens because the default distance method of spec is bray, but for the bray distance method, the row sum of the data (for each selected group) cannot be 0. So, you can solve this problem by setting the parameter spec_dist = dist_func(.FUN = "vegdist", method = "euclidean").

library(linkET)
set.seed(123)
spec <- data.frame(x = sample(0:2, 100, TRUE), y = sample(0:2, 100, TRUE))
env <- data.frame(x = rnorm(100), y = rnorm(100))

## Error: Reproduce your question
mantel_test(spec, env)
## OK
mantel_test(spec, env, spec_dist = dist_func(.FUN = "vegdist", method = "euclidean"))

from linket.

Hy4m avatar Hy4m commented on June 7, 2024

Hi Bing

I think this happens because the default distance method of spec is bray, but for the bray distance method, the row sum of the data (for each selected group) cannot be 0. So, you can solve this problem by setting the parameter spec_dist = dist_func(.FUN = "vegdist", method = "euclidean").

library(linkET)
set.seed(123)
spec <- data.frame(x = sample(0:2, 100, TRUE), y = sample(0:2, 100, TRUE))
env <- data.frame(x = rnorm(100), y = rnorm(100))

## Error: Reproduce your question
mantel_test(spec, env)
## OK
mantel_test(spec, env, spec_dist = dist_func(.FUN = "vegdist", method = "euclidean"))

In the next update, I'll be more careful with spec's default distance algorithm.

from linket.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.