Radial_plot: Radial bar plot of ethnobotany indices

View source: R/Radial_plot.R

Radial_plotR Documentation

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")


ethnobotanyR documentation built on Dec. 28, 2022, 2:15 a.m.