add_list_length: Add a context-specific list-length

View source: R/add_list_length.R

add_list_lengthR Documentation

Add a context-specific list-length

Description

Optionally creating a single column list with the full context.

Usage

add_list_length(
  df,
  taxa_col = "taxa",
  context,
  create_list_col = FALSE,
  sep = "_"
)

Arguments

df

Data frame with taxa and context columns.

taxa_col

Character column name in df with taxa.

context

Character vector of columns names defining the context.

create_list_col

Create a single column named list with the full context separated by sep.

sep

Separator between contexts if create_list_col

Value

Data frame with extra column(s) list length, named sr, and, optionally, list name, list.


Acanthiza/envTrend documentation built on Nov. 16, 2023, 4:24 p.m.