biometry / bipartite

repository for the bipartite R-package for network analysis
35 stars 16 forks source link

commsimulator defunct in vegan 2.5-1 #3

Closed jarioksa closed 6 years ago

jarioksa commented 6 years ago

This PR adapts bipartite to recently released vegan 2.5-1 which finally defuncts commsimulator function. After vegan update, bipartite::nullmodel will fail with method=4 & binary input data, but this PR fixes the issue. This also fixes NAMESPACE and tweaks a manual page for the update.

The fix cannot be made very cleanly, because bipartite::nullmodel function now calls vegan::nullmodel, and this necessarily gives a name clash. I have avoided this by not importing nullmodel from vegan, but instead I use a double colon call to make the difference. I expect that CRAN gatekeepers will accept this because the two packages have functions with exactly identical names.

NB, there will be a message of nullmodel name clash when loading library(bipartite). This probably happens because bipartite Depends on vegan, and this attaches vegan namespace. However, bipartite::nullmodel will mask vegan::nullmodel. To get rid of this message, you should not Depend on vegan, but I have not checked what kind of changes in code and examples that would cause.

If you want to have specifics on vegan versions, this fix requires vegan (>= 2.2) which is pretty old, though (Nov 17, 2014), and probably rare at the wild.

cdormann commented 6 years ago

Dear Jari, many thanks for the pull request! I'll set up the modifications of bipartite accordingly. Cheers, Carsten