expandYearlyCosts {invacost} | R Documentation |
Expand cost values per year of the database over relevant periods of impact
Description
For costs that occur over several years, this function repeats the cost value per year over each year of the relevant period of impact.
Usage
expandYearlyCosts(costdb, startcolumn, endcolumn)
Arguments
costdb |
The 'InvaCost' database, usually obtained with
|
startcolumn |
Name of the column containing starting years |
endcolumn |
Name of the column containing ending years |
Value
A data.frame
containing the 'InvaCost' database where
all costs occurring over several years are repeated for each year.
Note
Information on the beginning and ending years was not directly provided in
literature sources of economic costs for a substantial part of entries in the
database (Probable_starting_year
and Probable_ending_year
columns
).
Therefore, for papers for which this information was not available,
educated guesses were made by the 'InvaCost' team on the probable starting
and ending years. These educated guesses were designed
to be conservative, and make no assumption as of whether the economic impacts
have been continued after the publication year of the material where the cost
was collected.
Therefore, we used the publication year as the probable ending year. For
costs repeated over several years but for which no information with respect
to the exact periods of impact was available, we counted only a single year.
These educated guesses are included in the columns (columns
Probable_starting_year_adjusted
and
Probable_ending_year_adjusted
), and we recommend using them the base
scenario, as its conservative assumptions limit over-estimations of the
costs.
Author(s)
Boris Leroy leroy.boris@gmail.com, Andrew Kramer, Anne-Charlotte Vaissière, Christophe Diagne
References
https://github.com/Farewe/invacost
Leroy Boris, Kramer Andrew M, Vaissière Anne-Charlotte, Kourantidou Melina, Courchamp Franck & Diagne Christophe (2022). Analysing economic costs of invasive alien species with the invacost R package. Methods in Ecology and Evolution. doi:10.1111/2041-210X.13929
Examples
data(invacost)
### Cleaning steps
# Eliminating data with no information on starting and ending years
invacost <- invacost[-which(is.na(invacost$Probable_starting_year_adjusted)), ]
invacost <- invacost[-which(is.na(invacost$Probable_ending_year_adjusted)), ]
# Keeping only observed and reliable costs
invacost <- invacost[invacost$Implementation == "Observed", ]
invacost <- invacost[which(invacost$Method_reliability == "High"), ]
# Eliminating data with no usable cost value
invacost <- invacost[-which(is.na(invacost$Cost_estimate_per_year_2017_USD_exchange_rate)), ]
### Expansion
db.over.time <- expandYearlyCosts(invacost,
startcolumn = "Probable_starting_year_adjusted",
endcolumn = "Probable_ending_year_adjusted")