Nothing
shannon <-function(x){
#Calculate Shannon's Diversity Index given a list of binomial alleles
t <- table(x)
if (length(t)<2) return(NaN)
P=t[1]/sum(t)
Q=t[2]/sum(t)
S=-(P*log(P)+Q*log(Q))
return(S)
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.