R/utils.R
replace_by_importance.RdReplace diet data entries below a given importance threshold
replace_by_importance(x, threshold, replace_with = NA, which_measures = "all")
| x | data.frame: diet data, as returned by |
|---|---|
| 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) |
data.frame
if (FALSE) { x <- so_diet() ## discard entries representing less than 10% of diet x <- x %>% replace_by_importance(0.1) }