Skip to content

conflicts_prefer() allows you to declare "winners" of conflicts, declaring one or many winners at once.

See conflict_prefer() for more precise control.

Usage

conflicts_prefer(..., .quiet = FALSE)

Arguments

...

Functions to prefer in form pkg::fun or pkg::fun().

.quiet

If TRUE, all output will be suppressed

Best practices

I recommend placing a single call to conflicts_prefer() at the top of your script, immediately after loading all needed packages with calls to library().

Examples

conflicts_prefer(
  dplyr::filter(),
  dplyr::lag(),
)
#> [conflicted] Removing existing preference.
#> [conflicted] Will prefer dplyr::filter over any other package.
#> [conflicted] Will prefer dplyr::lag over any other package.

# or
conflicts_prefer(
  dplyr::filter,
  dplyr::lag,
)
#> [conflicted] Removing existing preference.
#> [conflicted] Will prefer dplyr::filter over any other package.
#> [conflicted] Removing existing preference.
#> [conflicted] Will prefer dplyr::lag over any other package.