Error with aboot function when trying to use a custom distance on presence/absence data

104 views
Skip to first unread message

eoisriouéaép apoeidoisfdsd

unread,
Dec 2, 2019, 4:46:20 AM12/2/19
to poppr
I am trying to use a custom distance on presence/absence data with the function aboot but I keep getting the same error:

Error in .setupMethodsTables(fdef, initialize = TRUE) : no slot of name "group" for this object of class "derivedDefaultMethod" Called from: .setupMethodsTables(fdef, initialize = TRUE

I get the same message when using the Aeut dataset and the custom function "bindist" provided as example:

data(Aeut)
bindist <- function(x){ stopifnot(is.genind(x)) dist(tab(x), method = "binary") }
aboot(Aeut, dist = function(x) bootgen2genind(x) %>% bindist)



Zhian Kamvar

unread,
Dec 2, 2019, 4:51:34 AM12/2/19
to eoisriouéaép apoeidoisfdsd, poppr
Hello,

That definitely looks like a bug. I'll open an issue and try to get it fixed soon.

Best,
Zhian

--
You received this message because you are subscribed to the Google Groups "poppr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to poppr+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/poppr/6d0e8d40-bf2c-4e4b-989a-aca0c93f5d8f%40googlegroups.com.

eoisriouéaép apoeidoisfdsd

unread,
Dec 2, 2019, 5:24:16 AM12/2/19
to poppr
Great, thank you Zhian!

Can you let me know when this is fixed? I'll keep an eye on this thread!

Thanks again


Le lundi 2 décembre 2019 10:51:34 UTC+1, Zhian Kamvar a écrit :
Hello,

That definitely looks like a bug. I'll open an issue and try to get it fixed soon.

Best,
Zhian

On Mon, Dec 2, 2019 at 9:46 AM eoisriouéaép apoeidoisfdsd <apoei...@gmail.com> wrote:
I am trying to use a custom distance on presence/absence data with the function aboot but I keep getting the same error:

Error in .setupMethodsTables(fdef, initialize = TRUE) : no slot of name "group" for this object of class "derivedDefaultMethod" Called from: .setupMethodsTables(fdef, initialize = TRUE

I get the same message when using the Aeut dataset and the custom function "bindist" provided as example:

data(Aeut)
bindist <- function(x){ stopifnot(is.genind(x)) dist(tab(x), method = "binary") }
aboot(Aeut, dist = function(x) bootgen2genind(x) %>% bindist)



--
You received this message because you are subscribed to the Google Groups "poppr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to po...@googlegroups.com.

Zhian Kamvar

unread,
Dec 2, 2019, 5:27:20 AM12/2/19
to eoisriouéaép apoeidoisfdsd, poppr
I'll make sure to post back here once I have some time to track down and fix the bug. In the meantime, I've opened an issue here: https://github.com/grunwaldlab/poppr/issues/210

Best,
Zhian

To unsubscribe from this group and stop receiving emails from it, send an email to poppr+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/poppr/c531052d-1ccf-43c8-8ea2-10838801a9e0%40googlegroups.com.

Zhian Kamvar

unread,
Dec 6, 2019, 10:51:30 AM12/6/19
to eoisriouéaép apoeidoisfdsd, poppr
Hello,

The issue is the fact that aboot simply takes the matrix from presence/absence data instead of converting it to a bootgen object. You should be able to run the command like so and get the same answer:

aboot(tab(Aeut), dist = dist, method = "binary")

I will still work on generating a better warning and update here when I have done so.

Best,
Zhian

eoisriouéaép apoeidoisfdsd

unread,
Dec 10, 2019, 10:04:01 AM12/10/19
to poppr
Dear Zhian,

This solved my problem indeed, thank you for looking into it
Reply all
Reply to author
Forward
0 new messages