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

renyi index and plots #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 78 additions & 1 deletion herpR.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
# realizar mapas de las areas muestreadas a traves de rasters
#
#
#
# boxplot de familias comparadas para las dos reservas
#

install.packages("vegan") # instalar programa vegan para analisis

Expand Down Expand Up @@ -47,7 +50,81 @@ diversity(herp1, index = "simpson")

## anzu zunac
## [1] 0.9577778 0.8884688
##


specnumber(herp1)

H <- diversity(herp1) ## Shannon index
H

J <- H/log(specnumber(herp1)) ## Pielou’s evenness J = H0/log(S)
J

##
## R´enyi and Tsallis diversities
##

k <- sample(nrow(herp1), 2)
k

R <- renyi(herp1[k,])
R



plot(R)


## The plot uses Trellis graphics with a
## separate panel for each site. The dots
## show the values for sites, and the lines
## the extremes and median in the data set.
##
## los graficos que obtenemos nos muestran tres lineas la mediana
## y los extremos superior e inferior
##
##

boxplot(R)

## α parameter of Fisher’s log-series can be used as a diversity index
##
##

alpha <- fisher.alpha(herp1)
alpha

save.image("~/1.USFQ/TESIS/HERPETO/HERPETO/herpRworkspace.RData")

require(graphics)

plot(density(c(-20, rep(0,98), 20)), xlim = c(-4, 4)) # IQR = 0

# The Old Faithful geyser data
d <- density(faithful$eruptions, bw = "sj")
d
plot(tabla_de_especies_herpeto)

d <- density(herp1$)





data(dune)
data(dune.env)
mod <- cca(dune ~ A1 + Moisture + Management, dune.env)
plot(mod, type="n")
text(mod, dis="cn")
points(mod, pch=21, col="red", bg="yellow", cex=1.2)
text(mod, "species", col="blue", cex=0.8)
## Limited output of 'summary'
head(summary(mod), tail=2)
## Scaling can be numeric or more user-friendly names
## e.g. Hill's scaling for (C)CA
scrs <- scores(mod, scaling = "sites", hill = TRUE)
## or correlation-based scores in PCA/RDA
scrs <- scores(rda(dune ~ A1 + Moisture + Management, dune.env),
scaling = "sites", correlation = TRUE)


Binary file not shown.