Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple records with same name #11

Open
mwpennell opened this issue Oct 27, 2014 · 1 comment
Open

Multiple records with same name #11

mwpennell opened this issue Oct 27, 2014 · 1 comment
Labels

Comments

@mwpennell
Copy link

When a vector contains multiple species with the same name, diversitree uses only the first observation. The correct behavior should be to throw an error. I just corrected this in geiger
mwpennell/geiger-v2@b7a7d45

MWE

library(diversitree)

## simulate a continuous dataset
set.seed(1)
t <- tree.bd(c(1,0), max.taxa=10)
d <- sim.character(t,1)

## using the simulated dataset
lik <- make.bm(t,d)
lik(1)

## adding a species with same name to data
d2 <- c(d, "sp10"=1)
lik2 <- make.bm(t,d2)

## likelihood is the same
lik2(1)

## however, swapping order of species
d3 <- d2[c(1:9,11,10)]
lik3 <- make.bm(t,d3)

## different likelihood
lik3(1)
@richfitz richfitz added the bug label Oct 27, 2014
@richfitz
Copy link
Owner

Thanks Matt!

Possible fix following same type of bug in geiger: mwpennell/geiger-v2@b7a7d45

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants