Resulting 'best guess' cover values are generated from (in order): recorded in the field; taxa within environmental pca groups (defined within env_prcomp); and taxa across all its records. If more than one value is available, cov_func is used to summarise to a single value.

add_cover(
  df,
  context = "cell",
  env_prcomp,
  lucover,
  cover_cut_col = "cover_max",
  lucover_col = "cover_mid",
  small_cov = 0.009,
  remove_all_small = TRUE,
  fix_1to100 = TRUE,
  cov_func = "max"
)

Arguments

df

Dataframe with context, taxa and cover columns.

context

Character. Name of columns defining context.

env_prcomp

List. Result from call to envClean::env_pca()

lucover

Dataframe. Lookup from cover_code to numeric cover values

cover_cut_col

Character. Name of column in lucover containing values between 0 and 1 to use for assigning numeric cover values to a cover_code. This allows the values appearing in the resulting tibble column cover_adj to be continuous in 0 to 1.

lucover_col

Character. Name of column in lucover containing values to use for assigning numeric cover values to a cover_code. These do not have to be between 0 and 1. These values are reflected in the use_cover value in the resulting tibble.

small_cov

A small cover value assigned to any record for which there is no available site, pca or taxa cover value.

remove_all_small

Logical. If TRUE (default) context(s) where all taxa are assigned small_cov are removed.

fix_1to100

Logical. Any values found in cover field of df that are above 1 and less than or equal to 100 are divided by 100.

cov_func

Function to summarise cover values for any context with more than one cover value.

Value

Dataframe with taxa, context and the following 'cover' columns: cover_adj a best guess proportion cover; use_cover_code the cover_code values from lucover that correspond to the best guess value; use_cover the lucover_col column that corresponds to the best guess value.