Replace diet data entries below a given importance threshold

replace_by_importance(x, threshold, replace_with = NA, which_measures = "all")

Arguments

x

data.frame: diet data, as returned by so_diet

threshold

numeric: replace entries below this threshold

replace_with

numeric: value to replace with

which_measures

string: one or more of "fraction_diet_by_weight", "fraction_diet_by_prey_items", "fraction_occurrence", or "all" (shorthand for all three)

Value

data.frame

See also

Examples

if (FALSE) { x <- so_diet() ## discard entries representing less than 10% of diet x <- x %>% replace_by_importance(0.1) }