| Title: | Indian Alien Flora Information Database Retrieval |
|---|---|
| Description: | The Indian Alien Flora Information (ILORA) database contains 14 invasion-relevant variables for 1388 alien plant species in India. The package enables exploration of the database using user-defined criteria. Using this package, users can retrieve variable-specific and species-level data from the database. The package also supports exploratory data analysis and visualization to give users an idea of the variables of interest. Further details about the database are available at <https://iloradb.wixsite.com/alienflora>. |
| Authors: | Ruqaiya Shaikh [aut, cre], Achyut Kumar Banerjee [aut], Abhishek Mukherjee [aut], Amiya Ranjan Bhowmick [aut] |
| Maintainer: | Ruqaiya Shaikh <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.2 |
| Built: | 2026-05-12 14:30:15 UTC |
| Source: | https://github.com/cran/ILORA |
Retrieves species data from the sp_categorization table in the ILORA database
and creates a bar plot showing the number of species in each invasion status category.
Categories include Invasive (In), Naturalized (Nt), Casual Aliens (CA),
Cryptogenic (CG), and Native (N).
bar_plot()bar_plot()
A ggplot object representing the number of species in each invasion
status category.
# Generate a bar plot of species counts for each invasion status bar_plot()# Generate a bar plot of species counts for each invasion status bar_plot()
Retrieves market data from the market_dynamics table in the ILORA database
and computes key metrics for seed and plant prices. Metrics include average prices,
and identification of species with the highest and lowest prices for seeds,
nursery-live plants (NL), and plant-live plants (PL).
calculate_market_metrics()calculate_market_metrics()
NL refers to Nursery-Live plants and PL refers to Plant-Live plants. The function calculates averages across all species recorded in the database and identifies extremes for each price category.
A named list containing:
A data frame with average seed, NL plant, and PL plant prices.
Data frame with species having the highest seed price.
Data frame with species having the lowest seed price.
Data frame with species having the highest NL plant price.
Data frame with species having the lowest NL plant price.
Data frame with species having the highest PL plant price.
Data frame with species having the lowest PL plant price.
# Compute market metrics market_metrics <- calculate_market_metrics() # View average prices market_metrics$averages # View species with highest seed price market_metrics$highest_seed# Compute market metrics market_metrics <- calculate_market_metrics() # View average prices market_metrics$averages # View species with highest seed price market_metrics$highest_seed
Computes the Minimum Residence Time (MRT) for species based on their first recorded year in the ILORA database. MRT is defined as the difference between the current year and the species' first record year. Users can calculate MRT for specific species or all species.
calculate_mrt(species = "ALL")calculate_mrt(species = "ALL")
species |
Character vector or single string specifying species names to calculate MRT for.
Use |
A data frame with columns:
acc_species_name: The accepted species name.
first_year: The first recorded year of the species.
mrt: Minimum Residence Time (current year minus first recorded year).
If a specified species is not found in the database, a message is printed indicating the missing species.
Returns NULL if no matching records are found.
# Calculate MRT for all species all_species_mrt <- calculate_mrt(species = "ALL") # Calculate MRT for specific species species <- c("Species A", "Species B", "Species C") specific_species_mrt <- calculate_mrt(species)# Calculate MRT for all species all_species_mrt <- calculate_mrt(species = "ALL") # Calculate MRT for specific species species <- c("Species A", "Species B", "Species C") specific_species_mrt <- calculate_mrt(species)
Computes the total number of uses for species based on the economic_uses table
in the ILORA database. It sums across all use-related columns for each species.
calculate_total_uses(species = NULL)calculate_total_uses(species = NULL)
species |
Optional character vector of species names to filter results.
If |
A data frame with columns:
acc_species_name: The accepted species name.
acc_species_id: Internal species ID.
total_uses: Sum of all recorded uses across relevant economic use columns.
If no matching records are found, a message is printed and NULL is returned.
# Calculate total uses for all species all_species_uses <- calculate_total_uses() # Calculate total uses for specific species species_list <- c("Quercus robur L.", "Azadirachta indica") specific_species_uses <- calculate_total_uses(species_list)# Calculate total uses for all species all_species_uses <- calculate_total_uses() # Calculate total uses for specific species species_list <- c("Quercus robur L.", "Azadirachta indica") specific_species_uses <- calculate_total_uses(species_list)
This function acts as a dynamic interface to call any available EDA function from the ILORA package. Users specify which function to execute and pass any required arguments to that function.
EDA(func, ...)EDA(func, ...)
func |
Character string specifying the name of the function to call. |
... |
Additional arguments to pass to the specified function. |
Available functions that can be called through EDA() include:
Plots specified species on a map of India.
Bar plot showing counts of species across 5 invasion status categories.
Returns a list of bar plots for growth habit and duration, plus summary tables.
Pie chart showing species counts by introduction pathways.
Histogram of species first record years within a given interval.
Calculates Minimum Residence Time (MRT) for species as current year minus first record year.
Calculates total number of uses for each species.
Returns metrics for average seed/plant prices and species with highest/lowest prices.
Visualizes the native range of species on a global map.
Visualizes the naturalized range of species on a global map.
Use ?function_name for detailed help on each individual function.
The output of the specified EDA function. This could be a ggplot object, a Plotly object, a list of plots and summaries, or a data frame, depending on the function.
# Call the bar_plot function EDA("bar_plot") # Call plot_species_on_map with additional arguments EDA("plot_species_on_map", species_names = c("Quercus robur L."), palette = "inferno", opacity = 0.9, highlight = FALSE)# Call the bar_plot function EDA("bar_plot") # Call plot_species_on_map with additional arguments EDA("plot_species_on_map", species_names = c("Quercus robur L."), palette = "inferno", opacity = 0.9, highlight = FALSE)
Returns a vector of colors based on a specified palette name. Supports
built-in R palettes, RColorBrewer palettes, viridis palettes, and
custom diverging palettes.
generate_palette(n, palette)generate_palette(n, palette)
n |
Integer. Number of colors to generate. |
palette |
Character. Name of the palette. Supported values:
|
Character vector of color hex codes.
# Generate 5 colors from rainbow palette generate_palette(5, "rainbow") # Generate 10 colors from viridis palette generate_palette(10, "viridis")# Generate 5 colors from rainbow palette generate_palette(5, "rainbow") # Generate 10 colors from viridis palette generate_palette(10, "viridis")
Fetches either specific variables across tables or an entire table for one or more species from the ILORA database.
get_data(species_name, variables = NULL, table_name = NULL)get_data(species_name, variables = NULL, table_name = NULL)
species_name |
Character vector of species names to fetch data for.
Must match |
variables |
Character vector, optional. Specific variables to retrieve.
Should match variable names returned by |
table_name |
Character, optional. Name of the table to retrieve data from.
Either |
A data frame containing the requested species data. Returns an error if species or variables/table are not found.
# Retrieve specific variables get_data("Quercus robur L.", variables = c("Longitude", "Latitude")) # Retrieve all columns from a specific table get_data("Quercus robur L.", table_name = "habitat")# Retrieve specific variables get_data("Quercus robur L.", variables = c("Longitude", "Latitude")) # Retrieve all columns from a specific table get_data("Quercus robur L.", table_name = "habitat")
This function fetches detailed data for one or more species from multiple ILORA database tables. It retrieves taxonomy, invasion status, general information, native range, introduction pathways, uses, market data, habitat, naturalized range, occurrence and distribution, geography, and climate.
get_species_details(species_name)get_species_details(species_name)
species_name |
Character vector of species names to query. Must be non-empty. |
A structured list containing data frames for each category:
Taxonomic classification.
Invasion status of the species.
General species information.
Native range at TDWG level 2.
Introduction pathway and first record date in India.
Economic uses across different sectors.
Market metrics such as plant prices.
Habitat information.
Naturalized range at TDWG level 2.
List containing occurrence and distribution data frames.
List containing LULC, anthrome, and ecoregion data frames.
Climate-related data.
species_details <- get_species_details(c("Azadirachta indica", "Quercus robur L.")) species_details$taxonomy species_details$market_infospecies_details <- get_species_details(c("Azadirachta indica", "Quercus robur L.")) species_details$taxonomy species_details$market_info
This function connects to the ILORA database and retrieves all species names
available in the species_name table. It returns them as a character vector
in alphabetical order.
get_species_names()get_species_names()
A character vector containing all species names in the ILORA database. If no species are found, returns an empty character vector.
species_names <- get_species_names() head(species_names)species_names <- get_species_names() head(species_names)
This function connects to the ILORA database and returns all table names
in the public schema, excluding system tables.
get_table_names()get_table_names()
A character vector of table names. Returns an empty vector if no tables are found.
# Retrieve all user tables get_table_names()# Retrieve all user tables get_table_names()
This function connects to the ILORA database and retrieves all column names
for tables in the public schema. Columns are grouped by table name.
get_variable_names(include_id = FALSE)get_variable_names(include_id = FALSE)
include_id |
Logical; if FALSE (default), identifier columns such as
|
A named list. Each element is a character vector of column names for a table. If no tables/columns are found, returns an empty list.
# Retrieve variables excluding ID columns get_variable_names() # Retrieve variables including ID columns get_variable_names(include_id = TRUE)# Retrieve variables excluding ID columns get_variable_names() # Retrieve variables including ID columns get_variable_names(include_id = TRUE)
Provides tools to access, query, and visualize species occurrence data from the Indian Alien Flora Information (ILORA) database. The package enables users to retrieve species names, explore available variables, and extract species-level data based on user-defined criteria. It also supports exploratory data analysis and visualization to facilitate ecological and biogeographical research. Further details about the database are available at https://ilora2020.wixsite.com/ilora2020.
Opens the ILORA variable description PDF file (ILORA_HowToRead.pdf)
in the system's default PDF viewer. This guide helps users understand
the variables and structure of the ILORA dataset.
ilora_variable_guide()ilora_variable_guide()
This function uses utils::browseURL() to open the PDF file.
Depending on the user's system configuration, the file may open in
a web browser, external PDF viewer, or within RStudio's viewer pane.
No return value. This function is called for its side effect of opening the PDF file.
ilora_variable_guide()ilora_variable_guide()
Retrieves species data from the introduction table in the ILORA database,
counts distinct species for each reported introduction pathway, and generates a 3D pie chart
using Plotly. The summary table of counts is also printed.
introduction_pathways_plot()introduction_pathways_plot()
A plotly object representing a 3D pie chart of species counts by introduction pathway.
The summary table of top pathways is printed as a message.
# Generate pie chart for species introduction pathways plot <- introduction_pathways_plot() plot # Displays the Plotly pie chart# Generate pie chart for species introduction pathways plot <- introduction_pathways_plot() plot # Displays the Plotly pie chart
Retrieves first record years of species from the introduction table
in the ILORA database within a specified year interval and plots a histogram using ggplot2.
plot_first_record_year_histogram(start_year, end_year, binwidth = NULL)plot_first_record_year_histogram(start_year, end_year, binwidth = NULL)
start_year |
Numeric. Start year of the interval. |
end_year |
Numeric. End year of the interval. |
binwidth |
Numeric, optional. Width of histogram bins. If |
A ggplot object representing the histogram of species first record years.
# Plot histogram for species first records between 1990 and 2000 plot_first_record_year_histogram(start_year = 1990, end_year = 2000)# Plot histogram for species first records between 1990 and 2000 plot_first_record_year_histogram(start_year = 1990, end_year = 2000)
Visualizes occurrences of one or more species on a map of India using their latitude and longitude data from the ILORA database.
plot_species_on_map( species_names, custom_colors = NULL, palette = "viridis", opacity = 0.7, highlight = FALSE )plot_species_on_map( species_names, custom_colors = NULL, palette = "viridis", opacity = 0.7, highlight = FALSE )
species_names |
Character vector. Names of species to plot. Must match
|
custom_colors |
Optional. Named vector of colors for each species. If
provided, length must match |
palette |
Optional. Character string specifying a palette for colors.
Options include |
opacity |
Numeric. Opacity of the plotted points (0 to 1). Default 0.7. |
highlight |
Logical. If TRUE, highlights regions containing species occurrences. Default FALSE. |
Plots multiple species occurrences with either a specified palette or custom colors. Ensures spatial coordinates align with India's shapefile CRS.
A ggplot object displaying the species occurrences on a map of India.
# Plot multiple species with custom colors plot_species_on_map( c("Cyanus segetum Hill", "Cuphea llavea Lex."), custom_colors = c("orange", "blue") ) # Plot a single species using the heat palette and reduced opacity plot_species_on_map("Quercus robur L.", palette = "heat", opacity = 0.6) # Plot a species using custom colors and viridis palette plot_species_on_map("Avena sativa L.", custom_colors = c("orange"), palette = "viridis")# Plot multiple species with custom colors plot_species_on_map( c("Cyanus segetum Hill", "Cuphea llavea Lex."), custom_colors = c("orange", "blue") ) # Plot a single species using the heat palette and reduced opacity plot_species_on_map("Quercus robur L.", palette = "heat", opacity = 0.6) # Plot a species using custom colors and viridis palette plot_species_on_map("Avena sativa L.", custom_colors = c("orange"), palette = "viridis")
Retrieves species data from the general_information table in the ILORA database,
calculates the number of distinct species for each growth habit and duration category,
and generates bar plots to visualize these counts. Summary tables are also included.
species_count_plot()species_count_plot()
A list containing:
A ggplot object showing species counts by growth habit.
A ggplot object showing species counts by duration.
A data frame summarizing species counts by growth habit.
A data frame summarizing species counts by duration.
# Generate and display plots for growth habit and duration plots <- species_count_plot() print(plots$plot_growthhabit) print(plots$plot_duration)# Generate and display plots for growth habit and duration plots <- species_count_plot() print(plots$plot_growthhabit) print(plots$plot_duration)
This function retrieves the native range of one or more species from the ILORA database and plots their distribution on a global map using TDWG Level 2 regions.
visualize_native_range(species_name)visualize_native_range(species_name)
species_name |
Character vector of species names to plot. Use |
The function joins the native range data from the ILORA database with a TDWG Level 2 shapefile to display species’ native regions. Each species is color-coded, and overlapping ranges are handled to avoid duplicate polygons.
A ggplot2 object showing the native range of the specified species.
# Visualize native range of specific species visualize_native_range(c("Cyanus segetum Hill", "Avena sativa L."))# Visualize native range of specific species visualize_native_range(c("Cyanus segetum Hill", "Avena sativa L."))
This function retrieves the naturalized range of one or more species from the ILORA database and plots their distribution on a global map using TDWG Level 2 regions.
visualize_naturalized_range(species_name)visualize_naturalized_range(species_name)
species_name |
Character vector of species names to plot. Use |
The function joins the naturalized range data from the ILORA database with a TDWG Level 2 shapefile to display species’ naturalized regions. Each species is color-coded.
A ggplot2 object showing the naturalized range of the specified species.
# Visualize naturalized range of specific species visualize_naturalized_range(c("Cyanus segetum Hill", "Avena sativa L."))# Visualize naturalized range of specific species visualize_naturalized_range(c("Cyanus segetum Hill", "Avena sativa L."))