% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/matcher_of_traits.R
\name{matcher_of_traits}
\alias{matcher_of_traits}
\title{Finds which species have matching traits}
\usage{
matcher_of_traits(measurement_table, trait_columns, id_col = "species")
}
\arguments{
\item{measurement_table}{A table with the numerical measurements and biomass
used to compute allometric lms}

\item{trait_columns}{List of traits to match, should be column names in measurement_table}

\item{id_col}{Name of the column holding a unique identifier per species/taxon.
Default "species".}
}
\value{
Tibble of four columns: level = "traits", name = focus species,
stage of focus species, id = matched species
}
\description{
Evaluates all unique trait groupings and returns species that have the same
traits +/- 1
}
\examples{
# Fuzzy traits of three species, sp_a and sp_b within +/- 1 of each other
measurement_table <-
  data.frame(species = rep(c("sp_a", "sp_b", "sp_c"), each = 4),
             stage = "larva",
             size_col = c(1, 2, 3, 4, 1.2, 2.1, 3.3, 4.2, 8, 9, 10, 11),
             biomass_col = c(0.1, 0.4, 1, 2, 0.2, 0.5, 1.1, 2.2, 12, 15, 20, 26),
             AS1 = rep(c(1, 2, 5), each = 4),
             AS2 = rep(c(3, 3, 9), each = 4))

# sp_a and sp_b match each other, sp_c only itself
matcher_of_traits(measurement_table, trait_columns = c("AS1", "AS2"))
}
