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

sim.bdtree does not check correct parameter use #19

Closed
richelbilderbeek opened this issue Dec 8, 2015 · 3 comments
Closed

sim.bdtree does not check correct parameter use #19

richelbilderbeek opened this issue Dec 8, 2015 · 3 comments

Comments

@richelbilderbeek
Copy link

Hi Matthew,

I noticed it is easy to misuse sim.bdtree, as this code may convince you of:

library(geiger)

# Should give error: 'if stopping criterium is set to 'time', please do not set the number of taxa 'n'
sim.bdtree(b = 0.4, d = 0.1, stop = "time", n = 10, t = 10)
# Should give error: 'if stopping criterium is set to 'taxa', please do not set the time of the simulation 't'
sim.bdtree(b = 0.4, d = 0.1, stop = "taxa", n = 10, t = 10)
# Should give error: 'if stopping criterium is set to 'time', please provide a value for 'n''
sim.bdtree(b = 0.4, d = 0.1, stop = "time", n = 10)
# Should give error: 'if stopping criterium is set to 'taxa', please provide a value for 'n''
sim.bdtree(b = 0.4, d = 0.1, stop = "taxa", t = 10)

It would have saved me some debugging if geiger did check its arguments.

Could you fix it? If you assign me, I will provide a pull request. Note that I will change the default parameters for n and t to NA or NULL, but I do not expect this to break code (yet I may be wrong).

@richelbilderbeek
Copy link
Author

richelbilderbeek commented May 28, 2020

Hi @lukejharmon, for what reason is this Issue closed? Has it been done or will the suggestion be ignored?

  • If it has been done: awesome 👍
  • If it is ignored: too bad 🌈

@lukejharmon
Copy link
Collaborator

Neither - I implemented it but neither pushed the change nor commented here. My mistake! But it has been done now - see this commit

@richelbilderbeek
Copy link
Author

Awesome! Thanks 👍

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

No branches or pull requests

2 participants