Last data update: 2014.03.03

R: Calculate alpha, beta and gamma true entropies and...
edR Documentation

Calculate alpha, beta and gamma true entropies and diversities

Description

Calculates alpha, beta and gamma true diversities of a data set. The matrix or data frame is automatically scaled to row sums of one.

Usage

ed(x, q = 1, w = 1, retq = TRUE)

Arguments

x

the input matrix or data frame.

q

the order of diversity; typically 0, 1 or 2.

w

weights if required.

retq

if TRUE then diversities are returned; if FALSE the entropies for alpha and gamma are returned.

Value

a vector of entropies or diversities

See Also

dev2div, ed1, eds, eds1

Examples

data(spider6)
ed(spider6[,1:6])
ed(spider6[,1:6],q=0)
ed(spider6[,1:6],q=2)
ed(spider6[,1:6],retq=FALSE)
data(spider6)
ed(spider6[,1:6])

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(MDM)
Loading required package: nnet
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/MDM/ed.Rd_%03d_medium.png", width=480, height=480)
> ### Name: ed
> ### Title: Calculate alpha, beta and gamma true entropies and diversities
> ### Aliases: ed
> 
> ### ** Examples
> 
> data(spider6)
> ed(spider6[,1:6])
   alpha     beta    gamma 
2.968079 1.808576 5.367997 
> ed(spider6[,1:6],q=0)
   alpha     beta    gamma 
3.785714 1.584906 6.000000 
> ed(spider6[,1:6],q=2)
   alpha     beta    gamma 
2.548379 1.857993 4.734871 
> ed(spider6[,1:6],retq=FALSE)
  absums   gbsums 
1.087915 1.680455 
> data(spider6)
> ed(spider6[,1:6])
   alpha     beta    gamma 
2.968079 1.808576 5.367997 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>