-
Notifications
You must be signed in to change notification settings - Fork 98
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
Gini coefficient #419
Comments
It is called Simpson index in ecology, and it is available as |
Thank you. I found the Could I clarify that I have got the file format correct for the |
The > library(vegan)
> x1=c(0,1,2,5)
> x2=c(2,2,2,2)
>
> diversity(rbind(x1,x2), index="simpson")
x1 x2
0.53125 0.75000
>
> 1-sum((x1/sum(x1))^2)
[1] 0.53125
> 1-sum((x2/sum(x2))^2)
[1] 0.75 The > Gini(x1)
[1] 0.6666667
> Gini(x2)
[1] 0
It is up to you to decide what index you need for your scientific question. |
Hi,
I was wondering whether there is a function inside vegan for calculating the Gini coefficient, as this is another diversity metric that is used a lot for TCR/BCR repertoire analysis?
Many thanks,
Lucy
The text was updated successfully, but these errors were encountered: