| Type: | Package |
| Title: | Computes Diversity Indices with Archaeological Data |
| Version: | 0.2.0 |
| Description: | Companion package of Arnaud Barat, Andreu Sansó, Maite Arilla-Osuna, Ruth Blasco, Iñaki Pérez-Fernández, Gabriel Cifuentes-Alcobenda, Rubén Llorente, Daniel Vivar-Ríos, Ella Assaf, Ran Barkai, Avi Gopher, & Jordi Rosell-Ardèvol (2025), "Quantifying Diversity through Entropy Decomposition. Insights into Hominin Occupation and Carcass Processing at Qesem cave". |
| License: | GPL-2 |
| Imports: | methods |
| Encoding: | UTF-8 |
| LazyData: | true |
| RoxygenNote: | 7.3.3 |
| Suggests: | testthat (≥ 3.0.0) |
| Config/testthat/edition: | 3 |
| NeedsCompilation: | no |
| Packaged: | 2026-04-27 11:31:09 UTC; HP |
| Author: | Andreu Sansó [aut, cre], Arnaud Barat [aut], Jordi Rosell [aut] |
| Maintainer: | Andreu Sansó <andreu.sanso@uib.eu> |
| Depends: | R (≥ 3.5.0) |
| Repository: | CRAN |
| Date/Publication: | 2026-04-27 15:20:02 UTC |
Data used in the examples
Description
Data frame with number of fragments of bones of unidentified species but identified group for several levels in Qesem (Israel). Data source: Blasco, R., Rosell, J., Assaf, E., Barkai, R., Gopher, A., (2024)
Usage
data(Qesem_f)
Value
Data frame with 4 observations (groups) and 7 levels.
Author(s)
Blasco, R., Rosell, J., Assaf, E., Barkai, R., Gopher, A.
Source
Blasco, R., Rosell, J., Assaf, E., Barkai, R., Gopher, A., 2024. Exploring the lack of articular ends at the Middle Pleistocene site of Qesem Cave, Israel. Journal of Human Evolution 189, 103509. doi:10.1016/j.jhevol.2024.103509
References
Barat, A. Sansó, A. Arilla-Osuna, M. Blasco, R., Pérez-Fernández, I., Cifuentes-Alcobenda, G. Llorente, R., Vivar-Ríos, D., Assaf, E. Barkai, R., Gopher, A. & Rosell-Ardèvol, J., 2025. Quantifying Diversity through Entropy Decomposition. Insights into Hominin Occupation and Carcass Processing at Qesem cave. Blasco, R., Rosell, J., Assaf, E., Barkai, R., Gopher, A., 2024. Exploring the lack of articular ends at the Middle Pleistocene site of Qesem Cave, Israel. Journal of Human Evolution 189, 103509. doi:10.1016/j.jhevol.2024.103509
Examples
data(Qesem_f)
names(data)
# The following example replicates some of the results in
# Barat, A. Sansó, A. Arilla-Osuna, M. Blasco, R., Pérez-Fernández, I.,
# Cifuentes-Alcobenda, G. Llorente, R., Vivar-Ríos, D., Assaf, E. Barkai, R.,
# Gopher, A. & Rosell-Ardèvol, J., 2025. "Quantifying Diversity through Entropy
# Decomposition. Insights into Hominin Occupation and Carcass Processing at Qesem cave".
shannon_frag(Qesem_s$HU, Qesem_s$Group, Qesem_f$HU, Qesem_f$Group)
Data used in the examples
Description
Data frame with number of bones of different species and diferent levels in Qesem (Israel), and a factor related to the size of the animal. Data source: Blasco, R., Rosell, J., Assaf, E., Barkai, R., Gopher, A., (2024)
Usage
data(Qesem_s)
Value
Data frame with 15 observations and 7 levels.
Author(s)
Blasco, R., Rosell, J., Assaf, E., Barkai, R., Gopher, A.
Source
Blasco, R., Rosell, J., Assaf, E., Barkai, R., Gopher, A., 2024. Exploring the lack of articular ends at the Middle Pleistocene site of Qesem Cave, Israel. Journal of Human Evolution 189, 103509. doi:10.1016/j.jhevol.2024.103509
References
Barat, A. Sansó, A. Arilla-Osuna, M. Blasco, R., Pérez-Fernández, I., Cifuentes-Alcobenda, G. Llorente, R., Vivar-Ríos, D., Assaf, E. Barkai, R., Gopher, A. & Rosell-Ardèvol, J., 2025. Quantifying Diversity through Entropy Decomposition. Insights into Hominin Occupation and Carcass Processing at Qesem cave. Blasco, R., Rosell, J., Assaf, E., Barkai, R., Gopher, A., 2024. Exploring the lack of articular ends at the Middle Pleistocene site of Qesem Cave, Israel. Journal of Human Evolution 189, 103509. doi:10.1016/j.jhevol.2024.103509
Examples
data(Qesem_s)
names(Qesem_s)
# The following example replicates some of the results in
# Barat, A. Sansó, A. Arilla-Osuna, M. Blasco, R., Pérez-Fernández, I.,
# Cifuentes-Alcobenda, G. Llorente, R., Vivar-Ríos, D., Assaf, E. Barkai, R.,
# Gopher, A. & Rosell-Ardèvol, J., 2025. "Quantifying Diversity through Entropy
# Decomposition. Insights into Hominin Occupation and Carcass Processing at Qesem cave".
all_indices(Qesem_s$HU)
Diversity indices
Description
Computes and prints all the diversity indices
Usage
all_indices(x, groups = NULL, B = 1000, cl = 0.95)
Arguments
x |
Vector of dimension S (number of species) with the number of individuals observed in each species. NA values are allowed. 0 values are converted to NA. |
groups |
Vector of dimension S of factors indicating the groups. If omitted, the decomposition of the indicators is not done. |
B |
Number of bootstrap samples. The default is 1000. |
cl |
Confidence level. A value between 0 and 1. The default is 0.95. |
Value
No return value. It prints the value of all indicators
References
"Arnaud Barat, Andreu Sansó, Maite Arilla-Osuna, Ruth Blasco, Iñaki Pérez-Fernández, Gabriel Cifuentes-Alcobenda, Rubén Llorente, Daniel Vivar-Ríos, Ella Assaf, Ran Barkai, Avi Gopher, & Jordi Rosell-Ardèvol (2025): Quantifying Diversity through Entropy Decomposition. Insights into Hominin Occupation and Carcass Processing at Qesem cave"
See Also
shannon, dec_shannon, dominance, equitability, evenness, margalef, menhinick, simpson_D, simpson_E
Examples
data(Qesem_s)
all_indices(Qesem_s$HU)
all_indices(Qesem_s$HU, Qesem_s$Group)
Bootstrap estimates of the diversity indices
Description
Computes bootstrap standard error and confidence interval of the diversity indices
Usage
bs(x, ind = "shannon", B = 1000, cl = 0.95)
Arguments
x |
Vector of dimension S (number of species) with the number of individuals observed in each species. NA values are allowed. 0 values are converted to NA. |
ind |
Index to be computed. The default value is "shannon". Other possible values are: "simpson_E", "simpson_D", "menhinick", "margalef", "evenness", "equitability" and "dominance". |
B |
Number of bootstrap samples. The default is 1000. |
cl |
Confidence level. A value between 0 and 1. The default is 0.95. |
Value
-
s: Boostrap standard error. -
low: Lower limit of the confidence interval. -
up: Upper limit of the confidence interval.
References
"Quantifying Diversity through Entropy Decomposition: Insights into Hominin Occupation and Carcass Processing at Qesem cave"
Examples
data(Qesem_s)
bs(Qesem_s$HU)
Bootstrap estimates of the decomposed diversity indices
Description
Computes bootstrap confidence intervals of the decomposed diversity indices
Usage
bs_dec(x, groups, ind = "shannon", B = 1000, cl = 0.95)
Arguments
x |
Vector of dimension S (number of species) with the number of individuals observed in each species. NA values are allowed. 0 values are converted to NA. |
groups |
Vector of dimension S of factors indicating the groups of each species. |
ind |
Index to be computed. The default value is "shannon". The other possible value is "equitability". |
B |
Number of bootstrap samples. The default is 1000. |
cl |
Confidence level. A value between 0 and 1. The default is 0.95. |
Value
-
bt_low: Lower limit of the confidence interval for "between groups". -
bt_up: Upper limit of the confidence interval for "between groups". -
wt_low: Lower limit of the confidence interval for "within groups". -
bt_up: Upper limit of the confidence interval for "within groups".
References
"Quantifying Diversity through Entropy Decomposition: Insights into Hominin Occupation and Carcass Processing at Qesem cave"
Examples
data(Qesem_s)
bs_dec(Qesem_s$HU, Qesem_s$Group)
Check input
Description
Checks if x is a proper input
Usage
check_x(x)
Arguments
x |
Vector of dimension S (number of species) with the number of individuals observed in each species. NA values are allowed. 0 values are converted to NA. |
Value
x without NA or 0 values
References
"Quantifying Diversity through Entropy Decomposition: Insights into Hominin Occupation and Carcass Processing at Qesem cave"
Decomposition of the equitability index
Description
Computes equitability and its decomposition
Usage
dec_equit(x, groups)
Arguments
x |
Vector of dimension S (number of species) with the number of individuals observed in each species. NA values are allowed. 0 values are converted to NA. |
groups |
Vector of dimension S of factors indicating the group of each species. |
Value
-
equitability: Equitability index. -
within: Within groups equitability. -
between: Between groups equitability.
References
"Quantifying Diversity through Entropy Decomposition: Insights into Hominin Occupation and Carcass Processing at Qesem cave"
See Also
Examples
data(Qesem_s)
dec_equit(Qesem_s$HU, Qesem_s$Group)
Shannon diversity decomposition
Description
Computes Shannon diversity and its decomposition
Usage
dec_shannon(x, groups)
Arguments
x |
Vector of dimension S (number of species) with the number of individuals observed in each species. NA values are allowed. 0 values are converted to NA. |
groups |
Vector of dimension S of factors indicating the group of each species. |
Value
-
shannon: Shannon's total Entropy. -
within: Within groups entropy. -
between: Between groups entropy. -
groups: A data frame with information about each group: relative frequency, internal entropy and number of species.
References
"Quantifying Diversity through Entropy Decomposition: Insights into Hominin Occupation and Carcass Processing at Qesem cave"
See Also
Examples
data(Qesem_s)
dec_shannon(Qesem_s$HU, Qesem_s$Group)
Dominance index
Description
Modification of the Simpson's dominance index to be restricted between 0 and 1.
Usage
dominance(x)
Arguments
x |
Vector of dimension S (number of species) with the number of individuals observed in each species. NA values are allowed. 0 values are converted to NA. |
Value
Dominance index (Modified Simpson's dominance index).
References
"Quantifying Diversity through Entropy Decomposition: Insights into Hominin Occupation and Carcass Processing at Qesem cave"
See Also
Examples
data(Qesem_s)
dominance(Qesem_s$HU)
Equitability. J Pielou index
Description
Computes J Pielou index know as equitability
Usage
equitability(x)
Arguments
x |
Vector of dimension S (number of species) with the number of individuals observed in each species. NA values are allowed. 0 values are converted to NA. |
Value
Equitability. J Pielou index.
References
"Quantifying Diversity through Entropy Decomposition: Insights into Hominin Occupation and Carcass Processing at Qesem cave"
See Also
Examples
data(Qesem_s)
equitability(Qesem_s$HU)
Evenness index
Description
Modification of Simpson's evenness index to be restricted between 0 an 1.
Usage
evenness(x)
Arguments
x |
Vector of dimension S (number of species) with the number of individuals observed in each species. NA values are allowed. 0 values are converted to NA. |
Value
Evenness index.
References
"Quantifying Diversity through Entropy Decomposition: Insights into Hominin Occupation and Carcass Processing at Qesem cave"
See Also
Examples
data(Qesem_s)
evenness(Qesem_s$HU)
Margalef index
Description
Computes Margalef's index
Usage
margalef(x)
Arguments
x |
Vector of dimension S (number of species) with the number of individuals observed in each species. NA values are allowed. 0 values are converted to NA. |
Value
Margalef index.
References
"Quantifying Diversity through Entropy Decomposition: Insights into Hominin Occupation and Carcass Processing at Qesem cave"
Examples
data(Qesem_s)
margalef(Qesem_s$HU)
Menhinick index
Description
Computes Menhinick's index
Usage
menhinick(x)
Arguments
x |
Vector of dimension S (number of species) with the number of individuals observed in each species. NA values are allowed. 0 values are converted to NA. |
Value
Menhinick index.
References
"Quantifying Diversity through Entropy Decomposition: Insights into Hominin Occupation and Carcass Processing at Qesem cave"
Examples
data(Qesem_s)
menhinick(Qesem_s$HU)
Shannon diversity index
Description
Computes Shannon's diversity index
Usage
shannon(x)
Arguments
x |
Vector of dimension S (number of species) with the number of individuals observed in each species. NA values are allowed. 0 values are converted to NA. |
Value
Shannon's diversity index (Entropy).
References
"Quantifying Diversity through Entropy Decomposition: Insights into Hominin Occupation and Carcass Processing at Qesem cave"
See Also
Examples
data(Qesem_s)
shannon(Qesem_s$HU)
Shannon diversity decomposition
Description
Computes Shannon diversity and its decomposition
Usage
shannon_frag(x, gx, f, gf)
Arguments
x |
Vector of dimension S (number of species) with the number of individuals observed in each species. NA values are allowed. 0 values are converted to NA. |
gx |
Vector of dimension S of factors indicating the group of each species. G groups. |
f |
Vector of dimension G with the number (>0) of fragments in each group |
gf |
Vector of dimension G of factors indicating the groups to which the fragments "f" belong. |
Value
-
shannon: Shannon's total Entropy. -
within: Within groups entropy. -
between: Between groups entropy. -
groups: A data frame with information about each group: relative frequency, internal entropy and number of species.
References
"Quantifying Diversity through Entropy Decomposition: Insights into Hominin Occupation and Carcass Processing at Qesem cave"
See Also
Examples
data(Qesem_s)
data(Qesem_f)
shannon_frag(Qesem_s$HU, Qesem_s$Group, Qesem_f$HU, Qesem_f$Group)
Simpson's dominance index
Description
Computes Simpson's dominance index.
Usage
simpson_D(x)
Arguments
x |
Vector of dimension S (number of species) with the number of individuals observed in each species. NA values are allowed. 0 values are converted to NA. |
Value
Simpson's dominance index.
References
"Quantifying Diversity through Entropy Decomposition: Insights into Hominin Occupation and Carcass Processing at Qesem cave"
See Also
Examples
data(Qesem_s)
simpson_D(Qesem_s$HU)
Simpson's evenness index
Description
Computes Simpson's evenness index.
Usage
simpson_E(x)
Arguments
x |
Vector of dimension S (number of species) with the number of individuals observed in each species. NA values are allowed. 0 values are converted to NA. |
Value
Simpson's evenness index.
References
"Quantifying Diversity through Entropy Decomposition: Insights into Hominin Occupation and Carcass Processing at Qesem cave"
See Also
Examples
data(Qesem_s)
simpson_E(Qesem_s$HU)