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

Suggestion: adding the group argument to diversity() #393

Closed
oldi opened this issue Feb 2, 2021 · 3 comments
Closed

Suggestion: adding the group argument to diversity() #393

oldi opened this issue Feb 2, 2021 · 3 comments

Comments

@oldi
Copy link

oldi commented Feb 2, 2021

The group argument in specnumber() is very useful but it is missing for the diversity function. Yet calculating an index per group is what is regularly done, and it could speed up many processes for calculating diversity data . Hence, I suggest adding the group argument to diversity().

@jarioksa
Copy link
Contributor

jarioksa commented Feb 2, 2021

This was also suggested in StackOverflow. Then I did not implement this since I think it could confuse users: they use the argument, and get a (correct) result that they did not want. However, I could add this, but what do you mean with diversity by groups: the average diversity of sampling units in a group, or the diversity of the average (or sum) of sampling units in a group? I would think about the latter, but I'm afraid that many users would think that they get the first if they use this argument.

jarioksa added a commit that referenced this issue Feb 2, 2021
This allows easy calculation of additive diversity indices based
on diversity indicex. Earlier we had this arg only for specnumber
to get the species number of pooled SUs.

See github issue #393
@oldi
Copy link
Author

oldi commented Feb 2, 2021

You are right, I did not realize that the diversity value per group has to be something like the average Shannon value. I think this will really be confusing if it is not clear how the values are derived. Your suggestion of using the pooled diversity might then be even more confusing? Maybe it is better to leave it like it is and let the user work with the diversity output per sample.

jarioksa added a commit that referenced this issue Feb 24, 2021
@jarioksa
Copy link
Contributor

jarioksa commented Mar 5, 2021

Despite you giving up, I added that option to diversity. We have canned alternatives for partitioning diversity (adipart, multipart), and the groups argument is consistent with those (even with the "weighting" argument that I find strange). I also made those functions a bit easier to use.

@jarioksa jarioksa closed this as completed Mar 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants