Learn R Programming

rdiversity (version 1.2.1)

qDZ_single: Similarity-sensitive diversity of a single population

Description

Calculates the similarity-sensitive diversity of order q of a single population with given relative proportions.

Usage

qDZ_single(proportions, q, Z = diag(nrow(proportions)), Zp = Z %*%
  proportions)

Arguments

proportions

vector of mode numeric; contains the relative proportions of different individuals/types in a population.

q

object of class numeric; contains the order of diversity measurement.

Z

two-dimensional matrix of mode numeric; contains the pair-wise similarity of individuals/types in a population.

Zp

two-dimensional matrix of mode numeric; contains the ordinariness of individuals/types in population.

Value

Returns the similarity-sensitive diversity of order q.

Examples

Run this code
# NOT RUN {
pop <- sample(1:50, 5)

# Create similarity matrix
Z <- diag(1, length(pop))
Z[Z==0] <- 0.4

# Calculate similarity-sensitive diversity of order 0 (species richness)
qDZ_single(pop, 0, Z)

# }

Run the code above in your browser using DataLab