Title: | Exploration of Threathened Flora field data |
---|---|
Description: | A shiny app that explores data from Threathened Flora. It uses customized forms to explore the data and generate several plots, tables. |
Authors: | Antonio Jesús Pérez-Luque [cre, aut] , Juan Lorite [aut, ctb] |
Maintainer: | Antonio Jesús Pérez-Luque <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.0.0 |
Built: | 2024-10-29 15:53:57 UTC |
Source: | https://github.com/ajpelu/famexploreR |
This function generates a biometry plot based on the provided data frame. It visualizes the measurements of height, major diameter, and minor diameter for a specific species.
biometryPlot(x, base_size, axis_text_size = 24, ...)
biometryPlot(x, base_size, axis_text_size = 24, ...)
x |
A data frame containing biometric measurements for a species. |
base_size |
The base_size for the plot |
axis_text_size |
The size of the axis text |
... |
others ggplot parameters |
The function takes a data frame x
containing the following columns:
especie_code
: The species code.
id_individuo
: The individual identifier.
altura_cm
: Height in centimeters.
dmayor_cm
: Major diameter in centimeters.
dmenor_cm
: Minor diameter in centimeters.
The function creates a boxplot for each measurement type and uses custom colors. It also includes half-eye plots and half-point plots.
A biometry plot visualizing height, major diameter, and minor diameter.
This function calculates various statistics (mean, standard deviation, standard error, minimum, and maximum) for specified biometric variables in a data frame.
biometryStat(x, variables = c("altura_cm", "dmayor_cm", "dmenor_cm"))
biometryStat(x, variables = c("altura_cm", "dmayor_cm", "dmenor_cm"))
x |
A data frame containing biometric data. |
variables |
A character vector specifying the names of the biometric variables for which statistics will be calculated. Default is c('altura_cm', 'dmayor_cm', 'dmenor_cm'). |
A data frame with columns for each statistic (mean, sd, se, min, max) and a corresponding variable column.
This function computes summary statistics for specified flowering variables in a given data frame.
computeFlowering(x, var_interest)
computeFlowering(x, var_interest)
x |
A data frame containing the variables of interest. |
var_interest |
A character vector of variable names to be summarized. |
This function calculates the following summary statistics for each specified variable:
variable: The name of the variable.
n_ind: The number of individuals with non-zero values.
pct_ind: The percentage of individuals with non-zero values.
mean_count: The mean value of the variable for individuals with non-zero values.
sd_count: The standard deviation of the variable for individuals with non-zero values.
se_count: The standard error of the mean for the variable.
A data frame containing summary statistics for the specified variables.
## Not run: data <- data.frame( n_flores = c(0, 2, 3, 0, 5), n_frutos = c(0, 0, 4, 0, 6) ) count_columns <- c("n_flores", "n_frutos") result_summary <- computeFlowering(data, count_columns) ## End(Not run)
## Not run: data <- data.frame( n_flores = c(0, 2, 3, 0, 5), n_frutos = c(0, 0, 4, 0, 6) ) count_columns <- c("n_flores", "n_frutos") result_summary <- computeFlowering(data, count_columns) ## End(Not run)
This function computes diversity indices for plant communities based on the specified method.
diversityCommunity(x)
diversityCommunity(x)
x |
A list containing data frames |
The function first extracts the method used for data collection from the 'datos_generales' data frame. Based on the method, it selects the corresponding plant community data frame and calculates various diversity indices.
A data frame with diversity indices for plant communities.
This function calculates herbivory metrics from a given dataset and creates a corresponding ggplot.
herbivory( data, bar_color = "blue", point_fill = "green", point_color = "black", point_alpha = 0.9 )
herbivory( data, bar_color = "blue", point_fill = "green", point_color = "black", point_alpha = 0.9 )
data |
A data frame containing the herbivory data with columns including 'comido_pct', 'id_individuo', and other relevant variables. |
bar_color |
The color for the bar in the ggplot. Default is blue. |
point_fill |
The fill color for points in the ggplot. Default is green. |
point_color |
The outline color for points in the ggplot. Default is black. |
point_alpha |
The alpha (transparency) for points in the ggplot. Default is 0.9. |
A list containing:
'damage': A tibble with herbivory metrics.
'plot_damage': A ggplot object displaying herbivory metrics.
This dataset contains multiple data frames related to various aspects of a study. It includes data on general information, soil, humidity and temperature, excrement observations, focal species, herbivory, neighborhood, vegetation coverage, vegetation contacts, taxonomy, treatment, fencing, state of the fencing, and coordinate reference system information.
hojas_validas
hojas_validas
A data frame containing the names of the sheets of the forms
Launches the famexploreR app
launch_famexplorer()
launch_famexplorer()
This function calculates various neighbor abundance statistics based on input data.
neighborAbundance_stats(data, units = c("m2", "dm2", "cm2"), focal_sp)
neighborAbundance_stats(data, units = c("m2", "dm2", "cm2"), focal_sp)
data |
A data frame containing relevant columns, including "individuo" (individual ID), "diam_muestreo_vecindad_cm" (neighborhood sampling diameter in centimeters), "especie_vecina" (neighboring species), and "n_vecino" (number of neighbors). |
units |
A character vector specifying the units for area calculation. Options are "m2" (square meters), "dm2" (square decimeters), and "cm2" (square centimeters). |
focal_sp |
A character string specifying the focal species. |
A list containing two data frames:
A data frame with individual-level neighbor abundance statistics.
A data frame with summarized neighbor abundance statistics.
This function takes a data frame or tibble and groups it by neighbor species
(especie_vecina
). For each neighbor species, the function calculates the
number of plots where each species has been recorded, as well as several
statistics for the neighbor species: the mean, standard error, minimum,
and maximum abundance of the neighbor species in the plots where it is present.
neighborSpecies_stats(data)
neighborSpecies_stats(data)
data |
A data frame or tibble containing the data to be summarized. |
A tibble with the following columns:
especie_vecina: The grouping variable (neighbor species).
ab_mean: The mean abundance of the neighbor species.
ab_se: The standard error of the mean abundance.
ab_min: The minimum abundance of the neighbor species.
ab_max: The maximum abundance of the neighbor species.
present_at: The count of plots where each neighbor species is recorded.
present_at_per: The percentage of the sampled plots (individuo
) where each
neighbor species is recorded.
This function generates a bar plot to visualize plant community data based on the specified method.
plotCommunity(x, axis_text_size = 16, axis_title_size = 17, ...)
plotCommunity(x, axis_text_size = 16, axis_title_size = 17, ...)
x |
A list containing data frames for different aspects of the study. |
axis_text_size |
The size of the axis text. Default value=16 |
axis_title_size |
The size of the axis title. Default value=17 |
... |
others ggplot parameters |
The function first extracts the method used for data collection from the 'datos_generales' data frame. Based on the method, it selects the corresponding plant community data frame and creates a bar plot to visualize the coverage of plant species.
A bar plot visualizing plant community data.
This function generates a bar plot with error bars for flowering data, allowing you to specify whether to use standard error ("se") or standard deviation ("sd") error bars.
plotFlowering(x, error = "se", bar_color = "blue", ...)
plotFlowering(x, error = "se", bar_color = "blue", ...)
x |
A data frame containing the flowering data. |
error |
The type of error bars to use. Should be "se" (standard error) or "sd" (standard deviation). Default is "se". |
bar_color |
The color for the bars in the plot. Default is "blue". |
... |
others ggplot parameters |
A ggplot2 object representing the bar plot with error bars.
ggplot2
, geom_bar
, geom_errorbar
This function takes a data frame containing information about geographic coordinates and prepares it for spatial analysis by converting it into a Simple Features (sf) object.
prepareGeo(x)
prepareGeo(x)
x |
A data frame containing at least the columns 'campo' and 'valor', where 'campo' specifies the type of information (e.g., 'crs', 'coord_x', 'coord_y', 'elevacion'), and 'valor' contains the corresponding values. |
This function creates an sf object with spatial coordinates and attributes, from an input data frame thata contain specific columns for 'campo' and 'valor'.
A Simple Features (sf) object with spatial coordinates and attributes.
This function takes a tibble x
and a vector of field names mdfields
as
input and prepares an HTML popup content based on the specified fields.
preparePopup( x, mdfields = c("especie focal", "localidad", "site", "reference", "poblacion", "tratamiento", "elevacion", "fecha") )
preparePopup( x, mdfields = c("especie focal", "localidad", "site", "reference", "poblacion", "tratamiento", "elevacion", "fecha") )
x |
A tibble containing data with columns 'campo' and 'valor'. |
mdfields |
A vector of field names specifying which fields to include in the popup content. |
A character string containing HTML-formatted popup content.
This function reads data from all sheets of an uploaded file in ODS or XLSX format and returns them in a named list.
readAllsheets(upload_path, valid_sheets)
readAllsheets(upload_path, valid_sheets)
upload_path |
Character string specifying the path to the uploaded file. |
valid_sheets |
Character vector specifying the names of sheets that are expected to be in the uploaded file. |
A named list containing data from all sheets in the uploaded file, with sheet names as list names.
This function takes a tibble containing soil data, performs data summarization, and returns a formatted and summarized tibble.
summarizeSoil(x)
summarizeSoil(x)
x |
A tibble containing soil data. |
This function performs the following steps:
Removes rows with missing values.
Excludes certain columns from the analysis.
Calculates mean, standard deviation, and standard error for numeric columns.
Pivots the data into a long format.
Renames columns for clarity.
Pivots the data back to a wider format.
Rounds numeric columns to three decimal places.
A tibble with summarized soil data.
This function generates a ternary plot using the ggtern package with customizable axis labels. The function allows specifying the variable names for the x, y, and z axes. It also capitalizes the first letter of each variable name for axis labels.
ternaryPlot(data, xvar, yvar, zvar, bsize, point_size, ...)
ternaryPlot(data, xvar, yvar, zvar, bsize, point_size, ...)
data |
A data frame containing the data to be plotted. |
xvar |
The name of the variable to be plotted in the x-axis of the ternary plot. |
yvar |
The name of the variable to be plotted in the y-axis of the ternary plot. |
zvar |
The name of the variable to be plotted in the z-axis of the ternary plot. |
bsize |
The base font size for the plot. |
point_size |
The size of the points. |
... |
others ggplot parameters |
This function creates a ternary plot, where data points are represented
by points in a triangular coordinate system. The xvar
, yvar
, and zvar
arguments allow you to specify which variables from the data
argument should
be used for each axis. The function also capitalizes the first letter of each
variable name for use in the axis labels. You can adjust the base font size
(bsize
) for the plot to control the text size.
A ggtern plot object displaying the ternary plot.
ggtern
for more information on creating ternary plots using ggtern.
## Not run: # Example usage of the custom function with customized variable names data <- data.frame( arena = c(0.4, 0.3, 0.2, 0.1), arcilla = c(0.3, 0.4, 0.2, 0.1), limo = c(0.3, 0.3, 0.4, 0.1) ) ternaryPlot(data, xvar = 'arena', yvar = 'arcilla', zvar = 'limo') ## End(Not run)
## Not run: # Example usage of the custom function with customized variable names data <- data.frame( arena = c(0.4, 0.3, 0.2, 0.1), arcilla = c(0.3, 0.4, 0.2, 0.1), limo = c(0.3, 0.3, 0.4, 0.1) ) ternaryPlot(data, xvar = 'arena', yvar = 'arcilla', zvar = 'limo') ## End(Not run)
This function generates a bar plot with error bars that visualizes the abundance of neighboring species.
vecindadPlot(x, axis_text_size = 16, axis_title_size = 17, ...)
vecindadPlot(x, axis_text_size = 16, axis_title_size = 17, ...)
x |
A data frame containing data for plotting.
|
axis_text_size |
The size of the axis text. Default value=16 |
axis_title_size |
The size of the axis title. Default value=17 |
... |
others ggplot parameters |
A bar plot with error bars.