| Type: | Package |
| Title: | Ethnobotanical Analysis, Decision-Framing, and TEK Modeling |
| Description: | Tools for quantifying Traditional Ecological Knowledge (TEK), modeling TEK in decision frameworks, and designing structured decision-framing exercises in conservation and development contexts. The package implements quantitative ethnobotany indices (Use Value, Relative Frequency of Citation, etc.) but positions them within a larger framework of Bayesian modeling and participatory decision analysis. Includes critical assessment of indices' limitations and case studies of participatory workshops. |
| Version: | 0.3.0 |
| Date: | 2026-10-06 |
| Depends: | R (≥ 3.5.0) |
| Imports: | circlize, cowplot, dplyr, ggalluvial, ggplot2, ggridges, reshape2, magrittr |
| License: | GPL-2 | GPL-3 [expanded from: GPL] |
| URL: | https://CRAN.R-project.org/package=ethnobotanyR |
| BugReports: | https://github.com/CWWhitney/ethnobotanyR/issues |
| Encoding: | UTF-8 |
| LazyData: | true |
| Suggests: | lme4, testthat, broom, knitr, rmarkdown, tidyr, stringr, purrr, tibble, vegan, bnlearn, causaleffect, gRain, pbapply, tidyselect, tidyverse |
| VignetteBuilder: | knitr |
| Config/roxygen2/version: | 8.0.0 |
| NeedsCompilation: | no |
| Packaged: | 2026-10-06 20:23:02 UTC; corywhitney |
| Author: | Cory Whitney [aut, cre] |
| Maintainer: | Cory Whitney <whitney.cory@gmail.com> |
| Repository: | CRAN |
| Date/Publication: | 2026-10-16 07:50:02 UTC |
Cultural Importance index (CI)
Description
Calculates the Cultural Importance Index (CI) per species.
Usage
CIs(data)
Arguments
data |
is an ethnobotany data set with column 1 'informant' and 2 'sp_name' as row identifiers of informants and of species names respectively. The rest of the columns are the identified ethnobotany use categories. The data should be populated with counts of uses per informant (should be 0 or 1 values). |
Value
Data frame of species and Cultural Importance Index (CI) values.
Warning
Identification for informants and species must be listed by the names 'informant' and 'sp_name' respectively in the data set. The rest of the columns should all represent separate identified ethnobotany use categories. These data should be populated with counts of uses per informant (should be 0 or 1 values).
References
Tardio, Javier, and Manuel Pardo-de-Santayana. 2008. “Cultural Importance Indices: A Comparative Analysis Based on the Useful Wild Plants of Southern Cantabria (Northern Spain) 1.” Economic Botany 62 (1): 24–39.
Whitney, C. W., Bahati, J., and Gebauer, J. (2018), Ethnobotany and agrobiodiversity; valuation of plants in the homegardens of southwestern Uganda. Ethnobiology Letters, 9(2), 90-100. doi:10.14237/ebl.9.2.2018.503
Examples
#Use built-in ethnobotany data example
CIs(ethnobotanydata)
#Generate random dataset of three informants uses for four species
eb_data <- data.frame(replicate(10,sample(0:1,20,rep=TRUE)))
names(eb_data) <- gsub(x = names(eb_data), pattern = "X", replacement = "Use_")
eb_data$informant <- sample(c('User_1', 'User_2', 'User_3'), 20, replace=TRUE)
eb_data$sp_name <- sample(c('sp_1', 'sp_2', 'sp_3', 'sp_4'), 20, replace=TRUE)
CIs(eb_data)
Cultural Value of ethnospecies (CVe)
Description
Calculates the Cultural Value (CVe) per ethnospecies.
Usage
CVe(data)
Arguments
data |
is an ethnobotany data set with column 1 'informant' and 2 'sp_name' as row identifiers of informants and of ethnospecies names respectively. |
Value
Data frame of ethnospecies and Cultural Value (CVe) values.
Warning
Identification for informants and ethnospecies must be listed by the names 'informant' and 'sp_name' respectively in the data set. The rest of the columns should all represent separate identified ethnobotany use categories. These data should be populated with counts of uses per informant (should be 0 or 1 values).
References
Reyes-Garcia, V., T. Huanca, V. Vadez, and W. Leonard. 2006. “Cultural, Practical, and Economic Value of Wild Plants: A Quantitative Study in the Bolivian Amazon.” Economic Botany.
Examples
#Use built-in ethnobotany data example
CVe(ethnobotanydata)
#Generate random dataset of three informants uses for four species
eb_data <- data.frame(replicate(10,sample(0:1,20,rep=TRUE)))
names(eb_data) <- gsub(x = names(eb_data), pattern = "X", replacement = "Use_")
eb_data$informant <- sample(c('User_1', 'User_2', 'User_3'), 20, replace=TRUE)
eb_data$sp_name <- sample(c('sp_1', 'sp_2', 'sp_3', 'sp_4'), 20, replace=TRUE)
CVe(eb_data)
Frequency of Citation (FC)
Description
Calculates the frequency of citation (FC) per species.
Usage
FCs(data)
Arguments
data |
is an ethnobotany data set with column 1 'informant' and 2 'sp_name' as row identifiers of informants and of species names respectively. The rest of the columns are the identified ethnobotany use categories. The data should be populated with counts of uses per person (should be 0 or 1 values). |
Value
Data frame of species and frequency of citation (FC) values.
References
Prance, G. T., W. Balee, B. M. Boom, and R. L. Carneiro. 1987. “Quantitative Ethnobotany and the Case for Conservation in Amazonia.” Conservation Biology 1 (4): 296–310.
Examples
#Use built-in ethnobotany data example
FCs(ethnobotanydata)
#Generate random dataset of three informants uses for four species
eb_data <- data.frame(replicate(10,sample(0:1,20,rep=TRUE)))
names(eb_data) <- gsub(x = names(eb_data), pattern = "X", replacement = "Use_")
eb_data$informant<-sample(c('User_1', 'User_2', 'User_3'), 20, replace=TRUE)
eb_data$sp_name<-sample(c('sp_1', 'sp_2', 'sp_3', 'sp_4'), 20, replace=TRUE)
FCs(eb_data)
Fidelity Level (FL)
Description
Calculates the fidelity level (FL) of the various uses of a species, i.e. the ratio between the number of informants who independently cite the use of a species for the same purposes (Ns * 100) and the total number of informants who mentioned the plant for any use (FCs).
Usage
FLs(data)
Arguments
data |
is an ethnobotany data set with column 1 'informant' and 2 'sp_name' as row identifiers of informants and of species names respectively. The rest of the columns are the identified ethnobotany use categories. The data should be populated with counts of uses per person (should be 0 or 1 values). |
Value
Data frame of species and fidelity level (FL) values.
Warning
Identification for informants and species must be listed by the names 'informant' and 'sp_name' respectively in the data set. The rest of the columns should all represent separate identified ethnobotany use categories. These data should be populated with counts of uses per informant (should be 0 or 1 values).
References
Friedman, J., Z. Yaniv, A. Dafni, and D. Palewitch. 1986. “A Preliminary Classification of the Healing Potential of Medicinal Plants, Based on a Rational Analysis of an Ethnopharmacological Field Survey Among Bedouins in the Negev Desert, Israel.” Journal of Ethnopharmacology 16 (2-3): 275–87.
Examples
#Use built-in ethnobotany data example
FLs(ethnobotanydata)
#returns the primary use category (Primary.use) and the FLs value
#Generate random dataset of three informants uses for four species
eb_data <- data.frame(replicate(10,sample(0:1,20,rep=TRUE)))
names(eb_data) <- gsub(x = names(eb_data), pattern = "X", replacement = "Use_")
eb_data$informant <- sample(c('User_1', 'User_2', 'User_3'), 20, replace=TRUE)
eb_data$sp_name <- sample(c('sp_1', 'sp_2', 'sp_3', 'sp_4'), 20, replace=TRUE)
FLs(eb_data)
Number of Uses (NU)
Description
Calculates the number of uses (NU) per species.
Usage
NUs(data)
Arguments
data |
is an ethnobotany data set with column 1 'informant' and 2 'sp_name' as row identifiers of informants and of species names respectively. The rest of the columns are the identified ethnobotany use categories. The data should be populated with counts of uses per person (should be 0 or 1 values). |
Value
Data frame of species and number of uses (NU) values.
Warning
Identification for informants and species must be listed by the names 'informant' and 'sp_name' respectively in the data set. The rest of the columns should all represent separate identified ethnobotany use categories. These data should be populated with counts of uses per informant (should be 0 or 1 values).
References
Prance, G. T., W. Balee, B. M. Boom, and R. L. Carneiro. 1987. “Quantitative Ethnobotany and the Case for Conservation in Amazonia.” Conservation Biology 1 (4): 296–310.
Examples
#Use built-in ethnobotany data example
NUs(ethnobotanydata)
#Generate random dataset of three informants uses for four species
eb_data <- data.frame(replicate(10,sample(0:1,20,rep=TRUE)))
names(eb_data) <- gsub(x = names(eb_data), pattern = "X", replacement = "Use_")
eb_data$informant<-sample(c('User_1', 'User_2', 'User_3'), 20, replace=TRUE)
eb_data$sp_name<-sample(c('sp_1', 'sp_2', 'sp_3', 'sp_4'), 20, replace=TRUE)
NUs(eb_data)
Relative Frequency of Citation (RFC)
Description
Calculates the relative frequency of citation (RFC) per species published by Pardo-de-Santayana (2003).
Usage
RFCs(data)
Arguments
data |
is an ethnobotany data set with column 1 'informant' and 2 'sp_name' as row identifiers of informants and of species names respectively. The rest of the columns are the identified ethnobotany use categories. The data should be populated with counts of uses per person (should be 0 or 1 values). |
Value
Data frame of species and relative frequency of citation (RFC) values.
Warning
Identification for informants and species must be listed by the names 'informant' and 'sp_name' respectively in the data set. The rest of the columns should all represent separate identified ethnobotany use categories. These data should be populated with counts of uses per informant (should be 0 or 1 values).
References
Tardio, Javier, and Manuel Pardo-de-Santayana. 2008. “Cultural Importance Indices: A Comparative Analysis Based on the Useful Wild Plants of Southern Cantabria (Northern Spain) 1.” Economic Botany 62 (1): 24–39.
Examples
#Use built-in ethnobotany data example
RFCs(ethnobotanydata)
#Generate random dataset of three informants uses for four species
eb_data <- data.frame(replicate(10,sample(0:1,20,rep=TRUE)))
names(eb_data) <- gsub(x = names(eb_data), pattern = "X", replacement = "Use_")
eb_data$informant <- sample(c('User_1', 'User_2', 'User_3'), 20, replace=TRUE)
eb_data$sp_name <- sample(c('sp_1', 'sp_2', 'sp_3', 'sp_4'), 20, replace=TRUE)
RFCs(eb_data)
Relative Importance index (RI)
Description
Calculates the relative importance index (RI) per species, published by Pardo-de-Santayana (2003).
Usage
RIs(data)
Arguments
data |
is an ethnobotany data set with column 1 'informant' and 2 'sp_name' as row identifiers of informants and of species names respectively. The rest of the columns are the identified ethnobotany use categories. The data should be populated with counts of uses per person (should be 0 or 1 values). |
Value
Data frame of species and relative importance index (RI) values.
Warning
Identification for informants and species must be listed by the names 'informant' and 'sp_name' respectively in the data set. The rest of the columns should all represent separate identified ethnobotany use categories. These data should be populated with counts of uses per informant (should be 0 or 1 values).
References
Tardio, Javier, and Manuel Pardo-de-Santayana. 2008. “Cultural Importance Indices: A Comparative Analysis Based on the Useful Wild Plants of Southern Cantabria (Northern Spain) 1.” Economic Botany 62 (1): 24–39.
Examples
#Use built-in ethnobotany data example
RIs(ethnobotanydata)
#Generate random dataset of three informants uses for four species
eb_data <- data.frame(replicate(10,sample(0:1,20,rep=TRUE)))
names(eb_data) <- gsub(x = names(eb_data), pattern = "X", replacement = "Use_")
eb_data$informant <- sample(c('User_1', 'User_2', 'User_3'), 20, replace=TRUE)
eb_data$sp_name <- sample(c('sp_1', 'sp_2', 'sp_3', 'sp_4'), 20, replace=TRUE)
RIs(eb_data)
Radial bar plot of ethnobotany indices
Description
Creates a radial bar plot of ethnobotany indices in ethnobotanyR package using the ggplot2 library https://ggplot2.tidyverse.org/.
Usage
Radial_plot(data, analysis, colors = NULL, legend = "none")
Arguments
data |
is an ethnobotany data set with column 1 'informant' and 2 'sp_name' as row identifiers of informants and of species names respectively. The rest of the columns are the identified ethnobotany use categories. The data should be populated with counts of uses per person (should be 0 or 1 values). |
analysis |
is one of the quantitative ethnobotany functions from ethnobotanyR, i.e. ethnobotanyR::FCs. |
colors |
is the color palette to be used for the fill of the bars. The default is from the rainbow palette with the number of plants |
legend |
is the option for placing a legend in the radial plot (fits ggplot2 'legend.position' argument). The default is "none" |
Value
Radial bar plot of chosen ethnobotany indices in ethnobotanyR package.
Warning
Identification for informants and species must be listed by the names 'informant' and 'sp_name' respectively in the data set. The rest of the columns should all represent separate identified ethnobotany use categories. These data should be populated with counts of uses per informant (should be 0 or 1 values).
References
Wickham, Hadley. “Reshaping Data with the Reshape Package.” Journal of Statistical Software 21, no. 12 (2007): 1–20.
Wickham, Hadley. ggplot2: Elegant Graphics for Data Analysis. Springer, 2016.
Examples
#Use built-in ethnobotany data example and Frequency of Citation function FCs()
Radial_plot(ethnobotanydata, analysis = FCs)
#Generate random dataset of three informants uses for four species
eb_data <- data.frame(replicate(10,sample(0:1,20,rep=TRUE)))
names(eb_data) <- gsub(x = names(eb_data), pattern = "X", replacement = "Use_")
eb_data$informant <- sample(c('User_1', 'User_2', 'User_3'), 20, replace=TRUE)
eb_data$sp_name <- sample(c('sp_1', 'sp_2', 'sp_3', 'sp_4'), 20, replace=TRUE)
Radial_plot(data = eb_data, analysis = URs, legend = "none")
Use Report (UR)
Description
Calculates the use reports (UR) per species, a common metric for ethnobotany studies.
Usage
URs(data)
Arguments
data |
is an ethnobotany data set with column 1 'informant' and 2 'sp_name' as row identifiers of informants and of species names respectively. The rest of the columns are the identified ethnobotany use categories. The data should be populated with counts of uses per person (should be 0 or 1 values). |
Value
Data frame of species and use reports (UR) values.
Warning
Identification for informants and species must be listed by the names 'informant' and 'sp_name' respectively in the data set. The rest of the columns should all represent separate identified ethnobotany use categories. These data should be populated with counts of uses per informant (should be 0 or 1 values).
References
Prance, G. T., W. Balee, B. M. Boom, and R. L. Carneiro. 1987. “Quantitative Ethnobotany and the Case for Conservation in Amazonia.” Conservation Biology 1 (4): 296–310.
Whitney, Cory W., J. Gebauer, and M. Anderson. “A Survey of Wild Collection and Cultivation of Indigenous Species in Iceland.” Human Ecology 40, no. 5 (2012): 781–87. doi:10.1007/s10745-012-9517-0
Examples
#Use built-in ethnobotany data example
URs(ethnobotanydata)
#Generate random dataset of three informants uses for four species
eb_data <- data.frame(replicate(10, sample(0:1, 20, rep = TRUE)))
names(eb_data) <- gsub(x = names(eb_data), pattern = "X", replacement = "Use_")
eb_data$informant <- sample(c('User_1', 'User_2', 'User_3'), 20, replace = TRUE)
eb_data$sp_name <- sample(c('sp_1', 'sp_2', 'sp_3', 'sp_4'), 20, replace = TRUE)
URs(eb_data)
Sum of all Use Reports (UR) for all species
Description
Calculates the sum of all ethnobotany use reports (UR) for all species, a common metric for ethnobotany studies.
Usage
URsum(data)
Arguments
data |
is an ethnobotany data set with column 1 'informant' and 2 'sp_name' as row identifiers of informants and of species names respectively. The rest of the columns are the identified ethnobotany use categories. The data should be populated with counts of uses per person (should be 0 or 1 values). |
Value
Single value sum of all ethnobotany use reports (UR) for all species in the data.
Warning
Identification for informants and species must be listed by the names 'informant' and 'sp_name' respectively in the data set. The rest of the columns should all represent separate identified ethnobotany use categories. These data should be populated with counts of uses per informant (should be 0 or 1 values).
References
Prance, G. T., W. Balee, B. M. Boom, and R. L. Carneiro. 1987. “Quantitative Ethnobotany and the Case for Conservation in Amazonia.” Conservation Biology 1 (4): 296–310.
Examples
#Use built-in ethnobotany data example
URsum(ethnobotanydata)
#Generate random dataset of three informants uses for four species
eb_data <- data.frame(replicate(10,sample(0:1,20,rep=TRUE)))
names(eb_data) <- gsub(x = names(eb_data), pattern = "X", replacement = "Use_")
eb_data$informant <- sample(c('User_1', 'User_2', 'User_3'), 20, replace=TRUE)
eb_data$sp_name <- sample(c('sp_1', 'sp_2', 'sp_3', 'sp_4'), 20, replace=TRUE)
URsum(eb_data)
Use Value (UV) index per species
Description
Calculates the use value (UV) index for each species in the data set (see Tardio and Pardo-de-Santayana 2008). This is calculated the same as the CIs function.
Usage
UVs(data)
Arguments
data |
is an ethnobotany data set with column 1 'informant' and 2 'sp_name' as row identifiers of informants and of species names respectively. The rest of the columns are the identified ethnobotany use categories. The data should be populated with counts of uses per person (should be 0 or 1 values). |
Value
Data frame of species and use value (UV) index results.
Warning
Identification for informants and species must be listed by the names 'informant' and 'sp_name' respectively in the data set. The rest of the columns should all represent separate identified ethnobotany use categories. These data should be populated with counts of uses per informant (should be 0 or 1 values).
References
Tardio, Javier, and Manuel Pardo-de-Santayana. “Cultural Importance Indices: A Comparative Analysis Based on the Useful Wild Plants of Southern Cantabria (Northern Spain)1.” Economic Botany 62, no. 1 (May 2008): 24–39. doi:10.1007/s12231-007-9004-5
Examples
#Use built-in ethnobotany data example
UVs(ethnobotanydata)
#Generate random dataset of three informants uses for four species
eb_data <- data.frame(replicate(10,sample(0:1,20,rep=TRUE)))
names(eb_data) <- gsub(x = names(eb_data), pattern = "X", replacement = "Use_")
eb_data$informant<-sample(c('User_1', 'User_2', 'User_3'), 20, replace=TRUE)
eb_data$sp_name<-sample(c('sp_1', 'sp_2', 'sp_3', 'sp_4'), 20, replace=TRUE)
UVs(eb_data)
Chord diagram of ethnobotany uses and species
Description
Creates a simple chord diagram of species and uses for ethnobotany studies. For more on the circlize package see Zuguang Gu's 'Circular Visualization in R' https://jokergoo.github.io/circlize_book/book/
Usage
ethnoChord(data, by)
Arguments
data |
is an ethnobotany data set with column 1 'informant' and 2 'sp_name' as row identifiers of informants and of species names respectively. The rest of the columns are the identified ethnobotany use categories. The data should be populated with counts of uses per person (should be 0 or 1 values). |
by |
indicates the variable that should be mapped to the bottom of the chord diagram. This automatically defaults to the column referring to the species (by = "sp_name") |
Value
Chord diagram figure for each use by 'informant' (top half) related to each 'sp_name' (bottom half) in the data set. To change variable names try using the dplyr rename function.
Warning
Identification for informants and species must be listed by the names 'informant' and 'sp_name' respectively in the data set. The rest of the columns represent the identified ethnobotany use categories. These data should be populated with counts of uses per person (should be 0 or 1 values).
References
Gu, Zuguang, Lei Gu, Roland Eils, Matthias Schlesner, and Benedikt Brors. “Circlize Implements and Enhances Circular Visualization in R.” Bioinformatics, 2014, 393.
Whitney, C. W., Bahati, J., and Gebauer, J. (2018), Ethnobotany and agrobiodiversity; valuation of plants in the homegardens of southwestern Uganda. Ethnobiology Letters, 9(2), 90-100. doi:10.14237/ebl.9.2.2018.503
Examples
#Use built-in ethnobotany data example
ethnoChord(ethnobotanydata, by = "informant")
#Generate random dataset of three informants uses for four species
eb_data <- data.frame(replicate(10,sample(0:1,20,rep=TRUE)))
names(eb_data) <- gsub(x = names(eb_data), pattern = "X", replacement = "Use_")
eb_data$informant <- sample(c('User_1', 'User_2', 'User_3'), 20, replace=TRUE)
eb_data$sp_name <- sample(c('sp_1', 'sp_2', 'sp_3', 'sp_4'), 20, replace=TRUE)
ethnoChord(eb_data, by = "informant")
Alluvial plot of ethnobotany uses and species
Description
Creates a simple alluvial plot of species and uses for ethnobotany studies.
Usage
ethno_alluvial(data, alpha = 0, colors = NULL)
Arguments
data |
is an ethnobotany data set with column 1 'informant' and 2 'sp_name' as row identifiers of informants and of species names respectively. The rest of the columns are the identified ethnobotany use categories. The data should be populated with counts of uses per person (should be 0 or 1 values). |
alpha |
is a number between 0 and 1 for the level of transparency behind the labels on the strata (default is 0). |
colors |
is the color palette to be used for the fill of the bars. The default is from the rainbow palette with the number of plants in the data |
Value
Alluvial diagram showing all use reports for each use (center) related to each species (left) and informant (right) in the data set.
Warning
Identification for informants and species must be listed by the names 'informant' and 'sp_name' respectively in the data set. The rest of the columns represent the identified ethnobotany use categories. These data should be populated with counts of uses per person (should be 0 or 1 values).
References
Mon, Aye Mya, Yinxian Shi, Xuefei Yang, Pyae Phyo Hein, Thaung Naing Oo, Cory Whitney, and Yongping Yang. “The Uses of Fig (Ficus) by Five Ethnic Minority Communities in Southern Shan State, Myanmar.” Journal of Ethnobiology and Ethnomedicine 16, no. 5 (2020). doi:10.1186/s13002-020-00406-z
Examples
#Use built-in ethnobotany data example
ethno_alluvial(ethnobotanydata)
#Generate random dataset of three informants uses for four species
eb_data <- data.frame(replicate(10,sample(0:1,20,rep=TRUE)))
names(eb_data) <- gsub(x = names(eb_data), pattern = "X", replacement = "Use_")
eb_data$informant <- sample(c('User_1', 'User_2', 'User_3'), 20, replace=TRUE)
eb_data$sp_name <- sample(c('sp_1', 'sp_2', 'sp_3', 'sp_4'), 20, replace=TRUE)
# Default plot ####
ethno_alluvial(eb_data)
Gives a measure of the confidence we can have in the answers in the ethnobotany data.
Description
Determine the probability that informant citations for a given use are 'correct' given informant responses to the use category for each plant, an estimate of each person's prior_for_answers with this plant and use, and the number of possible answers about this plant use.
Usage
ethno_bayes_consensus(data, answers = 2, prior_for_answers, prior = -1)
Arguments
data |
is an ethnobotany data set with column 1 'informant' and 2 'sp_name' as row identifiers of informants and of species names respectively. The rest of the columns are the identified ethnobotany use categories. The data should be populated with counts of uses per person (should be 0 or 1 values). |
answers |
The number of possible answers per question. Responses must be whole numbers from 0 to answers - 1: use 2 for 0/1 data, or 11 for counts of 0 to 10. |
prior_for_answers |
Informant competence (probability of knowing the answer, 0 to 1): a single value or one value per row of data. Required. Competence is supplied, not estimated. |
prior |
a prior distribution of probabilities over all answers as a matrix. If this is not provided the function assumes a uniform distribution (prior = -1). |
Value
A matrix of posterior probabilities: rows are the answers 0 to answers - 1 (for binary data 0 = not used, 1 = used), columns are use categories.
A matrix, where columns represent plant use categories and rows represent responses per person and plant (matching the data). Each value represents the bayes_consensus that an answer was 'correct' for a particular use, within the cultural consensus framework.
Warning
Identification for informants and species must be listed by the names 'informant' and 'sp_name' respectively in the data set. The rest of the columns should all represent separate identified ethnobotany use categories. These data should be populated with counts of uses per informant (should be 0 or 1 values).
Application
ethnobotanyR users often have a large number of counts in cells of the data set after categorization (i.e one user cites ten different ‘food’ uses but this is just one category). Most quantitative ethnobotany tools are not equipped for cases where the theoretical maximum number of use reports in one category, for one species by one informant is >1. This function and the bayes_boot function may be useful to work with these richer datasets for the Bayes consensus analysis.
References
Oravecz, Z., Vandekerckhove, J., & Batchelder, W. H. (2014). Bayesian Cultural Consensus Theory. Field Methods, 1525822X13520280. doi:10.1177/1525822X13520280
Romney, A. K., Weller, S. C., & Batchelder, W. H. (1986). Culture as Consensus: A Theory of Culture and Informant Accuracy. American Anthropologist, 88(2), 313-338.
Examples
#Use built-in ethnobotany data example
#assign a non-informative prior to prior_for_answers with 'prior_for_answers=0.5'
ethno_bayes_consensus(ethnobotanydata, answers = 2, prior_for_answers = 0.5, prior = -1)
#Generate random dataset of three informants uses for four species
eb_data <- data.frame(replicate(10,sample(0:1,20,rep=TRUE)))
names(eb_data) <- gsub(x = names(eb_data), pattern = "X", replacement = "Use_")
eb_data$informant <- sample(c('User_1', 'User_2', 'User_3'), 20, replace=TRUE)
eb_data$sp_name <- sample(c('sp_1', 'sp_2', 'sp_3', 'sp_4'), 20, replace=TRUE)
#assign a non-informative prior to prior_for_answers
eb_prior_for_answers <- rep(0.5, len = nrow(eb_data))
ethno_bayes_consensus(eb_data, answers = 2, prior_for_answers = eb_prior_for_answers)
Beta-binomial probability of use
Description
Posterior probability that a random informant cites a use for a species, with a credible interval. Valid for small samples and rare uses, where the bootstrap in ethno_boot fails.
Usage
ethno_beta(data, level = 0.9, prior = c(1, 1))
Arguments
data |
An ethnobotany data set with columns 'informant' and 'sp_name' and one column per use category. Any value above 0 counts as a citation. |
level |
Credible interval level. Default 0.9. |
prior |
Beta prior, c(a, b). Default c(1, 1) is uniform. |
Value
A data frame with one row per species and use: 'k' informants citing, 'n' informants, posterior 'mean', 'lower' and 'upper'.
Limitations
Informants are treated as independent and as a random sample of the community. This is the share of informants citing a use, not the Use Value, which can exceed 1.
Examples
ethno_beta(ethnobotanydata)
Bootstrap analyses of ethnobotany indices
Description
Creates a non-parametric bootstrap as a Bayesian Model https://www.sumsar.net/blog/2015/04/the-non-parametric-bootstrap-as-a-bayesian-model/. This is meant to be applied for ethnobotany data and indices in the ethnobotanyR package. Performs a Bayesian bootstrap and returns a sample of size 'n1' representing the posterior distribution of the chosen statistic (i.e. 'mean'). The function returns a vector if the statistic is one-dimensional (like for mean(...)) or a data.frame if the statistic is multi-dimensional (like for the coefficients 'coefs.' of a regression model 'lm').
Usage
ethno_boot(data, statistic, n1 = 1000,
n2 = NULL, use_weights = FALSE, ...)
Arguments
data |
Can be either a vector, matrix or a data.frame. |
statistic |
A function that accepts data as its first argument. Should return a numeric vector. |
n1 |
The size of the bootstrap sample. |
n2 |
The sample size used to calculate the statistic for each bootstrap draw. Defaults to the number of observations. Ignored if 'use_weights = TRUE'. |
use_weights |
If TRUE the statistic is called as 'statistic(data, w)' with Dirichlet weights 'w' (e.g. 'weighted.mean'), the exact Bayesian bootstrap with no extra resampling noise. Default FALSE resamples 'n2' observations with the weights as probabilities. |
... |
Further arguments passed on to the statistic function. |
Value
Bayesian bootstrap of chosen ethnobotany indices in ethnobotanyR package.
Limitations
The bootstrap only reweights observed values. If all observations are identical (e.g. a use cited by 0 of n informants) every draw is identical and the interval has zero width, which is not credible for rare uses; the function warns in this case. For a binary use, a Beta-binomial posterior such as 'rbeta(n1, k + 1, n - k + 1)' is more appropriate. Rows are treated as independent, so clustering by informant, species or village is ignored.
Application
This function was inspired by Rasmus Bååth's “The Non-Parametric Bootstrap as a Bayesian Model” Publishable Stuff, 2015. https://www.sumsar.net/blog/2015/04/the-non-parametric-bootstrap-as-a-bayesian-model/. In order to understand the various possible applications of this function for ethnobotany analyses it is important to read through that work.
ethnobotanyR users often have a large number of counts in cells of the data set after categorization (i.e one user cites ten different ‘food’ uses but this is just one category). Most quantitative ethnobotany tools are not equipped for cases where the theoretical maximum number of use reports in one category, for one species by one informant is >1. This function and the ethno_bayes_consensus function may be useful to work with these richer datasets for the Bayes consensus analysis.
References
Bååth, Rasmus. “The Non-Parametric Bootstrap as a Bayesian Model” Publishable Stuff, 2015. https://www.sumsar.net/blog/2015/04/the-non-parametric-bootstrap-as-a-bayesian-model/. Rubin, Donald B. “The Bayesian Bootstrap.” Annals of Statistics 9, no. 1 (January 1981): 130–34. doi:10.1214/aos/1176345338.
Examples
#Use built-in ethnobotany data example
ethno_boot(data = ethnobotanydata$Use_1,
statistic = mean, n1 = 1000)
#Generate random dataset of three informants uses for four species
eb_data <- data.frame(replicate(10,sample(0:1,20,rep=TRUE)))
names(eb_data) <- gsub(x = names(eb_data), pattern = "X", replacement = "Use_")
eb_data$informant<-sample(c('User_1', 'User_2', 'User_3'), 20, replace=TRUE)
eb_data$sp_name<-sample(c('sp_1', 'sp_2', 'sp_3', 'sp_4'), 20, replace=TRUE)
# Simple Bayesian bootstrap of the mean ####
boot_dataUR <- URs(eb_data)
ethno_boot(data = boot_dataUR$URs, statistic = mean)
# Generate random dataset of three informants with multiple uses for four species
eb_multi_use_data <- data.frame(replicate(10,sample(0:10,20,rep=TRUE)))
names(eb_multi_use_data) <- gsub(x = names(eb_multi_use_data), pattern = "X", replacement = "Use_")
eb_multi_use_data$informant<-sample(c('User_1', 'User_2', 'User_3'), 20, replace=TRUE)
eb_multi_use_data$sp_name<-sample(c('sp_1', 'sp_2', 'sp_3', 'sp_4'), 20, replace=TRUE)
# Simple Bayesian bootstrap of the mean of Use_1 ####
ethno_boot(data = eb_multi_use_data$Use_1, statistic = mean)
Cultural consensus with estimated informant competence
Description
One-parameter consensus model for binary use data. Each informant has a competence D (0 = guessing, 1 = always agrees with the consensus), estimated from agreement with other informants across all species-use questions. Returns the probability that each species-use is 'used' in the consensus answer key. Fitted by EM (maximum a posteriori; competence has a Laplace smoothing prior).
Usage
ethno_consensus(data, prior_used = 0.5, max_iter = 100, tol = 1e-06)
Arguments
data |
An ethnobotany data set with columns 'informant' and 'sp_name' and one column per use category. Any value above 0 counts as a citation. |
prior_used |
Prior probability that a species-use is 'used'. Default 0.5. |
max_iter |
Maximum EM iterations. Default 100. |
tol |
Convergence tolerance. Default 1e-6. |
Value
A list with 'truth' (data frame: sp_name, use, p_used), 'competence' (data frame: informant, D) and 'converged'.
Limitations
Assumes one shared answer key and informants of equal knowledge across questions. Minority knowledge, such as healer or gender-specific knowledge, is treated as error. Needs many questions per informant (species x uses) and informants (roughly 10 or more) to estimate competence; with few the results are unstable. Probabilities become extreme as informants are added, so read them as ranks, not as calibrated certainty. Check that informants who disagree are not a different knowledge group before using.
References
Oravecz, Z., Vandekerckhove, J., & Batchelder, W. H. (2014). Bayesian Cultural Consensus Theory. Field Methods. doi:10.1177/1525822X13520280
Romney, A. K., Weller, S. C., & Batchelder, W. H. (1986). Culture as Consensus: A Theory of Culture and Informant Accuracy. American Anthropologist, 88(2), 313-338.
Examples
ethno_consensus(ethnobotanydata)
Informant saturation curve
Description
Number of distinct species-use citations as informants are added in random order. A curve that is still rising means more interviews would still find new uses, so use probabilities and rankings are likely to change.
Usage
ethno_saturation(data, n_perm = 200, level = 0.9)
Arguments
data |
An ethnobotany data set with columns 'informant' and 'sp_name' and one column per use category. Any value above 0 counts as a citation. |
n_perm |
Number of random informant orderings. Default 200. |
level |
Interval level across orderings. Default 0.9. |
Value
A data frame with 'n_informants', and the 'mean', 'lower' and 'upper' number of distinct species-use pairs.
Examples
sat <- ethno_saturation(ethnobotanydata)
plot(sat$n_informants, sat$mean, type = "l",
xlab = "Informants", ylab = "Distinct species-use pairs")
Ethnobotany data set.
Description
An ethnobotany dataset from 20 informants, four species and 10 uses column 1 'informant' lists the names or id's of knowledge holders column 2 'sp_name' lists the names or id's of species The other 10 columns are the identified ethnobotany use categories. The data is populated with counts of uses per person (0 and 1 values).
Usage
ethnobotanydata
Format
A data frame with 80 rows and 12 variables:
- informant
anonymized id's of 20 knowledge holders
- sp_name
id's of four species
- Use_1
one of the categorized uses of species, 0 and 1 values
- Use_2
one of the categorized uses of species, 0 and 1 values
- Use_3
one of the categorized uses of species, 0 and 1 values
- Use_4
one of the categorized uses of species, 0 and 1 values
- Use_5
one of the categorized uses of species, 0 and 1 values
- Use_6
one of the categorized uses of species, 0 and 1 values
- Use_7
one of the categorized uses of species, 0 and 1 values
- Use_8
one of the categorized uses of species, 0 and 1 values
- Use_9
one of the categorized uses of species, 0 and 1 values
- Use_10
one of the categorized uses of species, 0 and 1 values
...
Homegarden ethnobotany data from southwestern Uganda.
Description
Plants recorded in 102 homegardens in southwestern Uganda, with 14 use categories. Each informant is one family's garden. Same format as ethnobotanydata. This is the data set analyzed in Whitney et al. (2018); see also Whitney et al. (2017).
Usage
homegardens
Format
A data frame with 2870 rows and 16 variables:
- informant
garden id (102 gardens); letters are the survey site, number is the garden
- sp_name
225 species names
- food, sale, medicine, technical, ornament, fence, firewood, timber, shade, hygiene, animal_feed, share, pesticide, manure
use categories, 0 = not used, 1 = used
Details
One row is one species in one garden. Gardens only have rows for species they grow, so the number of informants differs by species: ethno_beta() estimates the share of gardens growing a species that use it. Use columns are 0/1 (1 = the species is used for that purpose in that garden); one species can have several uses. The data match the published analysis: 3,961 use reports, 225 species, 102 gardens. Only plants recorded on the first visit and identified were kept (as in the paper); the 'weed' category is excluded. Species names are as recorded in the survey, reduced to genus and epithet (or Musa group). Some uses are rare (for example, manure has 2 use reports); drop or merge sparse categories before modeling.
Source
Survey data of Whitney et al. (2017, 2018), held by the author (GitHub repository CWWhitney/Uganda_Homegarden_Agrobiodiv, files AllRawNoWeeds_v7.csv and GardenStats.csv). Rebuilt by data-raw/homegardens.R in the package source.
References
Whitney C, Tabuti JRS, Hensel O, Yeh C, Gebauer J, Luedeling E (2017). Homegardens and the future of food and nutrition security in southwest Uganda. Agricultural Systems, 154, 133-144. doi:10.1016/j.agsy.2017.03.009
Whitney C, Bahati J, Gebauer J (2018). Ethnobotany and agrobiodiversity: valuation of plants in the homegardens of southwestern Uganda. Ethnobiology Letters, 9(2), 90-100. doi:10.14237/ebl.9.2.2018.503
See Also
homegardens_info, homegardens_species
Examples
# share of gardens growing a species that report each use
head(ethno_beta(homegardens[homegardens$sp_name == "Persea americana", ]))
Garden covariates for the homegarden data.
Description
One row per garden in homegardens, for modeling use by garden. Coordinates, informant names and household characteristics of the survey are not included.
Usage
homegardens_info
Format
A data frame with 102 rows and 7 variables:
- informant
garden id, matches
homegardens$informant- district
Bushenyi, Rubirizi or Sheema
- village
survey village (9)
- altitude_m
altitude in metres
- area_m2
garden area in square metres
- nearest_market_km
distance to the nearest market in km
- travel_time_market_h
travel time to the nearest market in hours
Source
Survey data of Whitney et al. (2017, 2018), file GardenStats.csv.
References
Whitney C, Tabuti JRS, Hensel O, Yeh C, Gebauer J, Luedeling E (2017). Homegardens and the future of food and nutrition security in southwest Uganda. Agricultural Systems, 154, 133-144. doi:10.1016/j.agsy.2017.03.009
See Also
Species traits for the homegarden data.
Description
One row per species in homegardens, as recorded in the survey. Species with conflicting records take the most frequent value; three family typos were resolved by hand (see data-raw/homegardens.R).
Usage
homegardens_species
Format
A data frame with 225 rows and 4 variables:
- sp_name
species, matches
homegardens$sp_name- type
life form: annual forb, annual grass, palm, perennial forb, perennial grass, shrub, tree or vine
- family
plant family as recorded
- native
1 = recorded as native, 0 = recorded as not native
Source
Survey data of Whitney et al. (2017, 2018), file AllRawNoWeeds_v7.csv.
References
Whitney C, Bahati J, Gebauer J (2018). Ethnobotany and agrobiodiversity: valuation of plants in the homegardens of southwestern Uganda. Ethnobiology Letters, 9(2), 90-100. doi:10.14237/ebl.9.2.2018.503
See Also
Use Value (UV) index per species
Description
Calculates the simplified use value (UV) index for each species in the data set (see Albuquerque et al. 2006). This is calculated the same as the CIs function.
Usage
simple_UVs(data)
Arguments
data |
is an ethnobotany data set with column 1 'informant' and 2 'sp_name' as row identifiers of informants and of species names respectively. The rest of the columns are the identified ethnobotany use categories. The data should be populated with counts of uses per person (should be 0 or 1 values). |
Value
Data frame of species and simplified use value (UV) index values.
Warning
Identification for informants and species must be listed by the names 'informant' and 'sp_name' respectively in the data set. The rest of the columns should all represent separate identified ethnobotany use categories. These data should be populated with counts of uses per informant (should be 0 or 1 values).
References
Albuquerque, Ulysses P., Reinaldo FP Lucena, Julio M.Monteiro, Alissandra TN Florentino, and Cecilia de Fatima CBR Almeida. 2006. “Evaluating Two Quantitative Ethnobotanical Techniques.” Ethnobotany Research and Applications 4: 51–60.
Examples
#Use built-in ethnobotany data example
simple_UVs(ethnobotanydata)
#Generate random dataset of three informants uses for four species
eb_data <- data.frame(replicate(10,sample(0:1,20,rep=TRUE)))
names(eb_data) <- gsub(x = names(eb_data), pattern = "X", replacement = "Use_")
eb_data$informant <- sample(c('User_1', 'User_2', 'User_3'), 20, replace=TRUE)
eb_data$sp_name <- sample(c('sp_1', 'sp_2', 'sp_3', 'sp_4'), 20, replace=TRUE)
simple_UVs(eb_data)