Skip to contents

Generate best guess of cover for each taxa*context

Usage

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

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

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 between above 1 and less than or equal to 100 are divided by 100.

lucover_co

Character. Name of column in lucover containing cover values to use for any cover_code

Value

Dataframe with cov_col removed and replaced with best guess cover in column use_cover