Description Usage Arguments Details Value Author(s)
View source: R/compile_species_data.R
Compiles species data across a larger dataset with duplicate species names as defined by a species list from confirm_species_list
function.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | compile_species_data(
dat,
splist,
core_cols = c("expedition", "station", "core.id"),
sp_col = "species",
ab_col = "abundance",
unit_col = "unit",
start_col = "from",
end_col = "to",
ice_thick_col = "ice",
add_cols = c("gear", "longitude", "latitude", "date", "bottom_depth", "ice.type",
"snow"),
convert_unit = list(from = "1/L", to = "1/m2"),
summarise_cores = TRUE,
return_summary = TRUE,
round_digits = 0
)
|
dat |
data frame containing ice core species data to be combined. Must be in long format. |
splist |
species list. Preferably from |
core_cols |
A character vector specifying columns that separate individual ice-cores. |
sp_col |
Character specifying the name of the species column in |
ab_col |
Character specifying the name of the abundance column in |
unit_col |
Character specifying the name of the unit for the abundance column in |
start_col |
Character argument specifying the name of the column in |
end_col |
Character argument specifying the name of the column in |
ice_thick_col |
Character argument specifying the name of the column in |
add_cols |
A character vector containing names of the additional columns that should be included in the output. These columns are not used by the function otherwise. Additional columns cannot contain several unique values due to summarizing process. |
convert_unit |
List or |
summarise_cores |
Logical. Should core sections be summarized to a continuous core? If |
return_summary |
Logical. Should summary statistics be returned? |
round_digits |
Number of digits |
Built for ice-algae taxonomy data, but could be modified to work with any taxonomy data including plankton nets. The function is currently broken for wider use.
Implemented convert_unit argument alternatives:
NULL
: no conversion. Adundances summed up as they are (see summarise_cores
argument).
list(from = "per", to = "per")
: percentage abundances are summed up according to the summarise_cores
argument and scaled to 100 % (sum for an ice core or a section adds up to 100 %).
list(from = "rel", to = "rel")
: relative abundances are summed up by taking a mean for duplicate species or entire ice cores (if summarise_cores = TRUE
).
list(from = "rel", to = "per")
: relative abundances are first summed up and a percentage of their contribution is calculated. Abundances add up to 100 % for an ice core or a section depending on the summarise_cores
argument.
list(from = "1/L", to = "1/m2")
(or any other variations passed to convert_abundace
): Individuals per litre values converted to individuals per square metre before summing up abundances (see summarise_cores
argument)
Returns a data frame with columns specified in arguments. Drops any unspecified column.
Mikko Vihtakari
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.