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")

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

Examples

if (FALSE) { 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") }