conflict_prefer: Persistently prefer one function over another

Description Usage Arguments Best practices Examples

Description

conflict_prefer() allows you to declare "winners" of conflicts. You can either declare a specific pairing (i.e. dplyr::filter() beats base::filter()), or an overall winner (i.e. dplyr::filter() beats all comers).

Usage

1
conflict_prefer(name, winner, losers = NULL, quiet = FALSE)

Arguments

name

Name of function.

winner

Name of package that should win the conflict.

losers

Optional vector of packages that should lose the conflict. If omitted, winner will beat all comers.

quiet

If TRUE, all output will be suppressed

Best practices

I recommend placing calls to conflict_prefer() at the top of your script, immediately underneath the relevant library() call.

Examples

1
2
3
4
5
6
# Prefer over all other packages
conflict_prefer("filter", "dplyr")

# Prefer over specified package or packages
conflict_prefer("filter", "dplyr", "base")
conflict_prefer("filter", "dplyr", c("base", "filtration"))

conflicted documentation built on June 22, 2019, 1:02 a.m.