replace_by_importance: Replace diet data entries below a given importance threshold

Description Usage Arguments Value See Also Examples

View source: R/utils.R

Description

Replace diet data entries below a given importance threshold

Usage

1
2
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

so_diet filter_by_importance

Examples

1
2
3
4
5
6
## Not run: 
  x <- so_diet()
  ## discard entries representing less than 10% of diet
  x <- x %>% replace_by_importance(0.1)

## End(Not run)

SCAR/sohungry documentation built on Nov. 7, 2018, 12:24 p.m.