Package 'impIndicator'

Title: Impact Indicators of Alien Taxa
Description: Compute impact indicators of alien taxa using GBIF occurrence cube and EICAT assessment of alien species. Aggregates species impact of various scores due to mecahnism. Aggregates site impact of various scores due to species.
Authors: Mukhtar Muhammed Yahaya [aut, cre] , Sabrina Kumschick [aut, ctb] , Sandra MacFadyen [aut, ctb] , Pietro Landi [aut, ctb] , Cang Hui [aut, ctb] , Stellenbosch University (SU) [cph]
Maintainer: Mukhtar Muhammed Yahaya <[email protected]>
License: MIT + file LICENSE
Version: 0.0.1
Built: 2025-02-20 15:23:45 UTC
Source: https://github.com/b-cubed-eu/impIndicator

Help Index


EICAT data of acacia taxa An example of EICAT data containing species name, impact category and mechanism.

Description

EICAT data of acacia taxa An example of EICAT data containing species name, impact category and mechanism.

Usage

eicat_acacia

Format

A dataframe object containing 138 observations and 3 variables

scientific_name

species scientific name

impact_category

EICAT impact category

impact_mechanism

mecahnism of impact

Source

Jansen, C., Kumschick, S. A global impact assessment of Acacia species introduced to South Africa. Biol Invasions 24, 175–187 (2022). https://doi.org/10.1007/s10530-021-02642-0

See Also

Other Data: southAfrica_sf, taxa_Acacia

Examples

head(eicat_acacia,10)

Compute impact categories

Description

Aggregate species impact categories from impact data.

Usage

impact_cat(
  impact_data,
  species_list,
  trans = 1,
  col_category = NULL,
  col_species = NULL,
  col_mechanism = NULL
)

Arguments

impact_data

The dataframe of species impact which contains columns of ⁠impact_category,⁠ scientific_name and impact_mechanism.

species_list

The vector of species' list to aggregate their impact categories

trans

Numeric. The type of transformation to convert the EICAT categories to numerical values. 1 converts ("MC", "MN", "MO", "MR", "MV") to (0,1,2,3,4) 2 converts ("MC", "MN", "MO", "MR", "MV") to (1,2,3,4,5) and 3 converts ("MC", "MN", "MO", "MR", "MV") to (1,10,100,1000,10000)

col_category

The name of the column containing the impact categories. The first two letters each categories must be an EICAT short names (e.g "MC -Minimal concern")

col_species

The name of the column containing species names

col_mechanism

The name of the column containing mechanisms of impact

Value

The dataframe containing the aggregated species impact. max - maximum impact of a species. mean - mean impact of a species. max_mech - sum of maximum impact per categories of a species

See Also

Other Prepare data: taxa_cube()

Examples

# define species list
species_list <- c(
  "Acacia adunca",
  "Acacia baileyana",
  "Acacia binervata",
  "Acacia crassiuscula",
  "Acacia cultriformis",
  "Acacia cyclops",
  "Acacia dealbata",
  "Acacia decurrens",
  "Acacia elata"
)

agg_impact <- impact_cat(
  impact_data = eicat_acacia,
  species_list = species_list,
  trans = 1
)

Impact indicator

Description

Compute impact indicators of alien taxa

Usage

impact_indicator(
  cube,
  impact_data = NULL,
  method = NULL,
  trans = 1,
  col_category = NULL,
  col_species = NULL,
  col_mechanism = NULL
)

Arguments

cube

The data cube of class sim_cube or processed_cube from b3gbi::process_cube()

impact_data

The dataframe of species impact which contains columns of ⁠impact_category,⁠ scientific_name and impact_mechanism

method

The method of computing the indicator. The method used in the aggregation of within and across species in a site. The method can be precautionary, precautionary cumulative, mean, mean cumulative or cumulative.

trans

Numeric. The method of transformation to convert the EICAT categories to numerical values. 1 converts ("MC", "MN", "MO", "MR", "MV") to (0,1,2,3,4) 2 converts ("MC", "MN", "MO", "MR", "MV") to (1,2,3,4,5) and 3 converts ("MC", "MN", "MO", "MR", "MV") to (1,10,100,1000,10000)

col_category

The name of the column containing the impact categories. The first two letters of each categories must be an EICAT short names (e.g "MC - Minimal concern")

col_species

The name of the column containing species names

col_mechanism

The name of the column containing mechanisms of impact

Value

A dataframe of the invasive alien impact trend (class impact_indicator)

See Also

Other Indicator function: site_impact(), species_impact()

Examples

acacia_cube <- taxa_cube(
  taxa = taxa_Acacia,
  region = southAfrica_sf,
  res = 0.25,
  first_year = 2010
)
impact_value <- impact_indicator(
  cube = acacia_cube,
  impact_data = eicat_acacia,
  method = "mean cumulative",
  trans = 1
)

Plot impact indicator

Description

Produces a ggplot object to show the trend of the impact.

Usage

## S3 method for class 'impact_indicator'
plot(
  x,
  linewidth = 2,
  colour = "red",
  title_lab = "Impact indicator",
  y_lab = "impact score",
  text_size = 14,
  ...
)

Arguments

x

A dataframe of impact indicator. Must be a class of "impact_indicator"

linewidth

The width size of the line. Default is 2

colour

The colour of the line Default is "red"

title_lab

Title of the plot. Default is "Impact indicator"

y_lab

Label of the y-axis. Default is "impact score"

text_size

The size of the text of the plot. Default is "14"

...

Additional arguments passed to geom_line

Value

The ggplot object of the impact indicator, with the y- and x-axes representing the impact score and time respectively.

See Also

Other Plot: plot.site_impact(), plot.species_impact()

Examples

# create data_cube
acacia_cube <- taxa_cube(
  taxa = taxa_Acacia,
  region = southAfrica_sf,
  res = 0.25,
  first_year = 2010
)

# compute impact indicator
impact_value <- impact_indicator(
  cube = acacia_cube,
  impact_data = eicat_acacia,
  method = "mean cumulative",
  trans = 1
)
# plot impact indicator
plot(impact_value)

Plot site impact

Description

Produces the yearly impact map of a region

Usage

## S3 method for class 'site_impact'
plot(
  x,
  region = NULL,
  first_year = NULL,
  last_year = NULL,
  title_lab = "Impact map",
  text_size = 14,
  ...
)

Arguments

x

A dataframe of impact indicator. Must be a class of "site_impact"

region

sf or character. The shapefile of the region of study or a character which represent the name of a country. It is not compulsory but makes the plot more comprehensible.

first_year

The first year the impact map should include. Default starts from the first year included in x.

last_year

The last year the impact map should include. Default ends in the last year included in x.

title_lab

Title of the plot. Default is "Impact map"

text_size

The size of the text of the plot. Default is "14"

...

Additional arguments passed to geom_tile

Value

The ggplot of species yearly impact on the region.

See Also

Other Plot: plot.impact_indicator(), plot.species_impact()

Examples

# define cube for taxa
acacia_cube <- taxa_cube(
  taxa = taxa_Acacia,
  region = southAfrica_sf,
  res = 0.25,
  first_year = 2010
)

# compute site impact
siteImpact <- site_impact(
  cube = acacia_cube,
  impact_data = eicat_acacia,
  method = "precautionary cumulative",
  trans = 1

)

# visualise site impact
plot(x=siteImpact,
region= southAfrica_sf,
first_year = 2021)

Plot species impact

Description

Produces a ggplot to show the trend of the species impact.

Usage

## S3 method for class 'species_impact'
plot(
  x,
  alien_species = "all",
  linewidth = 1.5,
  title_lab = "Species impact",
  y_lab = "impact score",
  text_size = 14,
  ...
)

Arguments

x

A dataframe of impact indicator. Must be a class of "species_impact"

alien_species

The character vector containing names of the alien species to be included in the plot. Default is "all" which plot all species in the data frame

linewidth

The width size of the line. Default is 1.5

title_lab

Title of the plot. Default is "Species impact"

y_lab

Label of the y-axis. Default is "impact score"

text_size

The size of the text of the plot. Default is "14"

...

Additional arguments passed to geom_line

Value

The ggplot object of the species impact, with the y- and x-axes representing the impact score and time respectively.

See Also

Other Plot: plot.impact_indicator(), plot.site_impact()

Examples

# create data cube
acacia_cube <- taxa_cube(
  taxa = taxa_Acacia,
  region = southAfrica_sf,
  res = 0.25,
  first_year = 2010
)

# compute species impact
speciesImpact <- species_impact(
  cube = acacia_cube,
  impact_data = eicat_acacia,
  method = "mean",
  trans = 1
)

# visualise species impact
plot(speciesImpact)

Compute site impact indicator

Description

Compute site impact indicator

Usage

site_impact(
  cube,
  impact_data = NULL,
  method = NULL,
  trans = 1,
  col_category = NULL,
  col_species = NULL,
  col_mechanism = NULL
)

Arguments

cube

The data cube of class sim_cube or processed_cube from b3gbi::process_cube()

impact_data

The dataframe of species impact which contains columns of ⁠impact_category,⁠ scientific_name and impact_mechanism

method

The method of computing the indicator. The method used in the aggregation of within and across species in a site. The method can be precautionary, precautionary cumulative, mean, mean cumulative or cumulative.

trans

Numeric. The method of transformation to convert the EICAT categories to numerical values. 1 converts ("MC", "MN", "MO", "MR", "MV") to (0,1,2,3,4) 2 converts ("MC", "MN", "MO", "MR", "MV") to (1,2,3,4,5) and 3 converts ("MC", "MN", "MO", "MR", "MV") to (1,10,100,1000,10000)

col_category

The name of the column containing the impact categories. The first two letters each categories must be an EICAT short names (e.g "MC - Minimal concern")

col_species

The name of the column containing species names

col_mechanism

The name of the column containing mechanisms of impact

Value

The dataframe of impact indicator per sites (class site_impact)

See Also

Other Indicator function: impact_indicator(), species_impact()

Examples

# define cube for taxa
acacia_cube <- taxa_cube(
  taxa = taxa_Acacia,
  region = southAfrica_sf,
  res = 0.25,
  first_year = 2010
)

siteImpact <- site_impact(
  cube = acacia_cube,
  impact_data = eicat_acacia,
  method = "precautionary cumulative",
  trans = 1
)

South African sf An example of region sf for impact indicator.

Description

South African sf An example of region sf for impact indicator.

Usage

southAfrica_sf

Format

A 'sf' object of South African map

geometry

geometry of polygon

See Also

Other Data: eicat_acacia, taxa_Acacia

Examples

sf::plot_sf(southAfrica_sf)

Compute species impact indicator

Description

Compute species impact indicator

Usage

species_impact(
  cube,
  impact_data = NULL,
  method = NULL,
  trans = 1,
  col_category = NULL,
  col_species = NULL,
  col_mechanism = NULL
)

Arguments

cube

The data cube of class sim_cube or processed_cube from b3gbi::process_cube()

impact_data

The dataframe of species impact which contains columns of ⁠impact_category,⁠ scientific_name and impact_mechanism

method

The method of computing the indicator. The method used in the aggregation of within impact of species. The method can be "max", "mean" or "max_mech".

trans

Numeric. The method of transformation to convert the EICAT categories to numerical values. 1 converts ("MC", "MN", "MO", "MR", "MV") to (0,1,2,3,4) 2 converts ("MC", "MN", "MO", "MR", "MV") to (1,2,3,4,5) and 3 converts ("MC", "MN", "MO", "MR", "MV") to (1,10,100,1000,10000)

col_category

The name of the column containing the impact categories. The first two letters each categories must be an EICAT short names (e.g "MC - Minimal concern")

col_species

The name of the column containing species names

col_mechanism

The name of the column containing mechanisms of impact

Value

A dataframe of impact indicator per species (class species_impact)

See Also

Other Indicator function: impact_indicator(), site_impact()

Examples

acacia_cube <- taxa_cube(
  taxa = taxa_Acacia,
  region = southAfrica_sf,
  res = 0.25,
  first_year = 2010
)

speciesImpact <- species_impact(
  cube = acacia_cube,
  impact_data = eicat_acacia,
  method = "mean",
  trans = 1
)

GBIF occurrences data of acacia in South Africa An example of occurrence data from GBIF containing required column for impact indicator.

Description

GBIF occurrences data of acacia in South Africa An example of occurrence data from GBIF containing required column for impact indicator.

Usage

taxa_Acacia

Format

A dataframe object containing 19,100 rows and 6 variables

decimalLatitude

geographic latitude in decimal

decimalLongitude

geographic longitude in decimal

species

scientific name of species

speciesKey

GBIF species identification number

coordinateUncertaintyInMeters

radius of the uncertainty circle around geographic point

year

year occurrence was recorded

Source

https://doi.org/10.15468/dl.b6gda5

See Also

Other Data: eicat_acacia, southAfrica_sf

Examples

head(taxa_Acacia,10)

Prepare Data Cubes

Description

Prepare data cube to calculate species impact . The function taxa_cube can take in the scientific name of the taxa of interest as in character or GBIF occurrences data containing necessary columns. The GBIF occurrences is downloaded if scientific names is given.

Usage

taxa_cube(
  taxa,
  region,
  limit = 500,
  country = NULL,
  res = 0.25,
  first_year = NULL,
  last_year = NULL
)

Arguments

taxa

Character or dataframe. The character should be the scientific name of the focal taxa while the dataframe is the GBIF occurrences data which must contain "decimalLatitude","decimalLongitude","species","speciesKey", "coordinateUncertaintyInMeters","dateIdentified", and "year".

region

sf or character. The shapefile of the region of study or a character which represent the name of a country

limit

Number of records to return from GBIF download. Default is set to 500

country

Two-letter country code (ISO-3166-1) of Country for which the GBIP occurrences data should be downloaded.

res

The resolution of grid cells to be used. Default is 0.25

first_year

The year from which the occurrence should start from

last_year

The year at which the occurrence should end

Value

A data cube of sim_cubes

See Also

Other Prepare data: impact_cat()

Examples

acacia_cube <- taxa_cube(
  taxa = taxa_Acacia,
  region = southAfrica_sf,
  first_year = 2010
)