compile_species_data: Compile species data from ice cores

Description Usage Arguments Details Value Author(s)

View source: R/compile_species_data.R

Description

Compiles species data across a larger dataset with duplicate species names as defined by a species list from confirm_species_list function.

Usage

 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
)

Arguments

dat

data frame containing ice core species data to be combined. Must be in long format.

splist

species list. Preferably from confirm_species_list.

core_cols

A character vector specifying columns that separate individual ice-cores.

sp_col

Character specifying the name of the species column in dat.

ab_col

Character specifying the name of the abundance column in dat.

unit_col

Character specifying the name of the unit for the abundance column in dat.

start_col

Character argument specifying the name of the column in dat for the section start for the ice core in centimeters or meters.

end_col

Character argument specifying the name of the column in dat for the section end for the ice core in centimeters or meters.

ice_thick_col

Character argument specifying the name of the column in dat for ice thickness preferably in centimeters

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 NULL. Should the function convert supplied abundances using the convert_abundance function, a list giving from and to units have to be supplied. If conversion should not be made, use NULL (default). See details for alternatives.

summarise_cores

Logical. Should core sections be summarized to a continuous core? If TRUE (default), all sections are summarized, start_col and end_col removed from the output, and a $core_type column added. If FALSE core sections are returned as they are, but duplicate species names are summed up.

return_summary

Logical. Should summary statistics be returned?

round_digits

Number of digits start_col, end_col and ice_thick_col values should be rounded to. Set to NULL to avoid rounding. See round for details.

Details

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:

Value

Returns a data frame with columns specified in arguments. Drops any unspecified column.

Author(s)

Mikko Vihtakari


MikkoVihtakari/MarineDatabase documentation built on July 7, 2020, 2:16 a.m.