filter_by_name: Filter data by predator, prey, or taxon name

View source: R/filter.R

filter_by_nameR Documentation

Filter data by predator, prey, or taxon name

Description

A convenience function that matches on the species and/or group names. filter_by_predator_name is a convenience shorthand for filter_by_name(...,name_type="predator") filter_by_prey_name is a convenience shorthand for filter_by_name(...,name_type="prey")

Usage

filter_by_name(x, name, name_type)

filter_by_predator_name(x, name)

filter_by_prey_name(x, name)

Arguments

x

data.frame: diet data as returned by e.g. so_diet or so_isotopes

name

character: vector of one or more names to match on

name_type

string: one of "predator", "prey", "predatorprey" (to match on either predator names or prey names), or "taxon". If missing will default to predator names for diet data, and taxon names for isotope data

Value

data.frame

See Also

so_diet, so_isotopes

Examples

## Not run: 
  x <- so_isotopes()
  x %>% filter_by_name(c("Electrona", "Gymnoscopelus"), "taxon")

  x <- so_diet()
  x %>% filter_by_name("Electrona carlsbergi", name_type = "predator")
  ## equivalent to
  x %>% filter_by_predator_name("Electrona carlsbergi")

## End(Not run)


SCAR/sohungry documentation built on Nov. 2, 2023, 4:19 p.m.